Block partitioning methods for video coding

ABSTRACT

The present disclosure provides systems and methods for processing video content. The method can include: partitioning, along a partitioning edge, a plurality of blocks associated with a picture into a first partition and a second partition; performing inter prediction on the plurality of blocks, to generate a first prediction signal for the first partition and a second prediction signal for the second partition; and blending the first and second prediction signals for edge blocks associated with the partitioning edge.

CROSS REFERENCE TO RELATED APPLICATIONS

The present application is a continuation of Ser. No. 16/935,835 filedJul. 22, 2020, which claims the benefits of priority to U.S. ProvisionalApplication No. 62/887,039, filed Aug. 15, 2019, and U.S. ProvisionalApplication No. 62/903,970, filed Sep. 23, 2019, all of which areincorporated herein by reference in their entireties.

TECHNICAL FIELD

The present disclosure generally relates to video processing, and moreparticularly, to methods and systems for performing motion predictionusing triangle partitioning or geometric partitioning.

BACKGROUND

A video is a set of static pictures (or “frames”) capturing the visualinformation. To reduce the storage memory and the transmissionbandwidth, a video can be compressed before storage or transmission anddecompressed before display. The compression process is usually referredto as encoding and the decompression process is usually referred to asdecoding. There are various video coding formats which use standardizedvideo coding technologies, most commonly based on prediction, transform,quantization, entropy coding and in-loop filtering. The video codingstandards, such as the High Efficiency Video Coding (HEVC/H.265)standard, the Versatile Video Coding (VVC/H.266) standard, AVSstandards, specifying the specific video coding formats, are developedby standardization organizations. With more and more advanced videocoding technologies being adopted in the video standards, the codingefficiency of the new video coding standards get higher and higher.

SUMMARY OF THE DISCLOSURE

Embodiments of the present disclosure provide a method for processingvideo content. The method can include: partitioning, along apartitioning edge, a plurality of blocks associated with a picture intoa first partition and a second partition; performing inter prediction onthe plurality of blocks, to generate a first prediction signal for thefirst partition and a second prediction signal for the second partition;and blending the first and second prediction signals for edge blocksassociated with the partitioning edge.

Embodiments of the present disclosure provide a system for processingvideo content. The system can include: a memory storing a set ofinstructions; and at least one processor configured to execute the setof instructions to cause the system to perform: partitioning, along apartitioning edge, a plurality of blocks associated with a picture intoa first partition and a second partition; performing inter prediction onthe plurality of blocks, to generate a first prediction signal for thefirst partition and a second prediction signal for the second partition;and blending the first and second prediction signals for edge blocksassociated with the partitioning edge.

Embodiments of the present disclosure provide a non-transitory computerreadable medium storing instructions that are executable by at least oneprocessor of a computer system, wherein the execution of theinstructions causes the computer system to perform a method comprising:partitioning, along a partitioning edge, a plurality of blocksassociated with a picture into a first partition and a second partition;performing inter prediction on the plurality of blocks, to generate afirst prediction signal for the first partition and a second predictionsignal for the second partition; and blending the first and secondprediction signals for edge blocks associated with the partitioningedge.

BRIEF DESCRIPTION OF THE DRAWINGS

Embodiments and various aspects of the present disclosure areillustrated in the following detailed description and the accompanyingfigures. Various features shown in the figures are not drawn to scale.

FIG. 1 illustrates structures of an exemplary video sequence, consistentwith embodiments of the disclosure, consistent with embodiments of thedisclosure.

FIG. 2A illustrates a schematic diagram of an exemplary encoding processof a hybrid video coding system, consistent with embodiments of thedisclosure.

FIG. 2B illustrates a schematic diagram of another exemplary encodingprocess of a hybrid video coding system, consistent with embodiments ofthe disclosure.

FIG. 3A illustrates a schematic diagram of an exemplary decoding processof a hybrid video coding system, consistent with embodiments of thedisclosure.

FIG. 3B illustrates a schematic diagram of another exemplary decodingprocess of a hybrid video coding system, consistent with embodiments ofthe disclosure.

FIG. 4 is a block diagram of an exemplary apparatus for encoding ordecoding a video, consistent with embodiments of the disclosure.

FIG. 5 illustrates an exemplary inter prediction based on trianglepartition, consistent with embodiments of the disclosure.

FIG. 6 illustrates an exemplary table for associating a merge index withmotion vectors, consistent with embodiments of the disclosure.

FIG. 7 illustrates an exemplary chroma weight map and an exemplary lumaweight sample, consistent with embodiments of the disclosure.

FIG. 8 illustrates examples of the 4×4 subblocks for storing motionvectors located in the uni-predicted or bi-predicted area, consistentwith embodiments of the disclosure.

FIG. 9 illustrates an exemplary syntax structure of a merge mode,consistent with embodiments of the disclosure.

FIG. 10 illustrates another exemplary syntax structure of a merge mode,consistent with embodiments of the disclosure.

FIG. 11 illustrates exemplary geometric partitions, consistent withembodiments of the disclosure.

FIG. 12 illustrate an exemplary look-up table for dis[ ], consistentwith embodiments of the disclosure.

FIG. 13 illustrates an exemplary look-up table for GeoFilter[ ],consistent with embodiments of the disclosure.

FIG. 14 illustrates an exemplary look-up table for angleIdx anddistanceIdx, consistent with embodiments of the disclosure.

FIG. 15A illustrates an exemplary look-up table for stepDis, consistentwith embodiments of the disclosure.

FIG. 15B illustrates another exemplary look-up table for stepDis,consistent with embodiments of the disclosure.

FIG. 15C illustrates an exemplary look-up table for angleIdx anddistanceIdx when the total number of geometric partitioning submodes isset to 140, consistent with embodiments of the disclosure.

FIG. 15D illustrates an exemplary look-up table for angleIdx anddistanceIdx when the total number of geometric partitioning submodes isset to 108, consistent with embodiments of the disclosure.

FIG. 15E illustrates an exemplary look-up table for angleIdx anddistanceIdx when the total number of geometric partitioning submodes isset to 80, consistent with embodiments of the disclosure.

FIG. 15F illustrates an exemplary look-up table for angleIdx anddistanceIdx when the total number of geometric partitioning submodes isset to 64, consistent with embodiments of the disclosure.

FIG. 16 illustrates an exemplary syntax structure for a geometricpartition mode, consistent with embodiments of the disclosure.

FIG. 17A illustrates another exemplary syntax structure for a geometricpartition mode, consistent with embodiments of the disclosure.

FIG. 17B illustrates yet another exemplary syntax structure for ageometric partition mode, consistent with embodiments of the disclosure.

FIG. 18 illustrates an exemplary sub block transform for aninter-predicted block, consistent with embodiments of the disclosure.

FIG. 19 illustrates an example of unified syntax structure, consistentwith embodiments of the disclosure.

FIG. 20 illustrates another example of unified syntax structure,consistent with embodiments of the disclosure.

FIG. 21 illustrates yet another example of unified syntax structure,consistent with embodiments of the disclosure.

FIG. 22A illustrates an exemplary look-up table for angleIdx anddistanceIdx including triangle and geometric partitions, consistent withembodiments of the disclosure.

FIG. 22B illustrates another exemplary look-up table for angleIdx anddistanceIdx including triangle and geometric partitions, consistent withembodiments of the disclosure.

FIG. 23 illustrates an example of allowing angles that partition thelarger block dimension only, consistent with embodiments of thedisclosure.

FIG. 24 illustrates yet another exemplary look-up table for angleIdx anddistanceIdx including triangle and geometric partitions, consistent withembodiments of the disclosure.

FIG. 25 illustrates yet another exemplary look-up table for angleIdx anddistanceIdx including triangle and geometric partitions, consistent withembodiments of the disclosure.

FIG. 26 illustrates an exemplary look-up table for Dis[ ], consistentwith embodiments of the disclosure.

FIG. 27 illustrates an exemplary coding unit syntax structure,consistent with embodiments of the disclosure.

FIG. 28 illustrates examples of SBT and GEO partitionings, consistentwith embodiments of the disclosure.

FIG. 29 illustrates another exemplary coding unit syntax structure,consistent with embodiments of the disclosure.

FIG. 30 illustrates an exemplary look-up table for angleIdx anddistanceIdx when the total number of geometric partitioning submodes isset to 80, consistent with embodiments of the disclosure.

FIG. 31 illustrates an exemplary look-up table for angleIdx anddistanceIdx when the total number of geometric partitioning submodes isset to 64, consistent with embodiments of the disclosure.

FIG. 32 illustrates an exemplary look-up table for Rho[ ], consistentwith embodiments of the disclosure.

FIG. 33 illustrates a table of numbers of each operation per block,consistent with embodiments of the disclosure.

FIG. 34 illustrates an exemplary look-up table for Rho_(subblk)[ ],consistent with embodiments of the disclosure.

FIG. 35A illustrates exemplary masks of angle 135°, consistent withembodiments of the disclosure.

FIG. 35B illustrates exemplary masks of angle 45°, consistent withembodiments of the disclosure.

FIG. 36A illustrates exemplary masks of angle 135°, consistent withembodiments of the disclosure.

FIG. 36B illustrates exemplary masks of 45°, consistent with embodimentsof the disclosure.

FIG. 37 illustrates exemplary angles of triangle partition modes fordifferent block shapes, consistent with embodiments of the disclosure.

FIG. 38 illustrates an exemplary look-up table for angleIdx anddistanceIdx when the total number of geometric partitioning submodes isset to 140, consistent with embodiments of the disclosure

FIG. 39 is a flowchart of an exemplary method for processing videocontent, consistent with embodiments of the disclosure.

DETAILED DESCRIPTION

Reference will now be made in detail to exemplary embodiments, examplesof which are illustrated in the accompanying drawings. The followingdescription refers to the accompanying drawings in which the samenumbers in different drawings represent the same or similar elementsunless otherwise represented. The implementations set forth in thefollowing description of exemplary embodiments do not represent allimplementations consistent with the invention. Instead, they are merelyexamples of apparatuses and methods consistent with aspects related tothe invention as recited in the appended claims. Unless specificallystated otherwise, the term “or” encompasses all possible combinations,except where infeasible. For example, if it is stated that a componentmay include A or B, then, unless specifically stated otherwise orinfeasible, the component may include A, or B, or A and B. As a secondexample, if it is stated that a component may include A, B, or C, then,unless specifically stated otherwise or infeasible, the component mayinclude A, or B, or C, or A and B, or A and C, or B and C, or A and Band C.

Video coding systems are often used to compress digital video signals,for instance to reduce storage space consumed or to reduce transmissionbandwidth consumption associated with such signals. With high-definition(HD) videos (e.g., having a resolution of 1920×1080 pixels) gainingpopularity in various applications of video compression, such as onlinevideo streaming, video conferencing, or video monitoring, it is acontinuous need to develop video coding tools that can increasecompression efficiency of video data.

For example, video monitoring applications are increasingly andextensively used in many application scenarios (e.g., security, traffic,environment monitoring, or the like), and the numbers and resolutions ofthe monitoring devices keep growing rapidly. Many video monitoringapplication scenarios prefer to provide HD videos to users to capturemore information, which has more pixels per frame to capture suchinformation. However, an HD video bitstream can have a high bitrate thatdemands high bandwidth for transmission and large space for storage. Forexample, a monitoring video stream having an average 1920×1080resolution can require a bandwidth as high as 4 Mbps for real-timetransmission. Also, the video monitoring generally monitors 7×24continuously, which can greatly challenge a storage system, if the videodata is to be stored. The demand for high bandwidth and large storage ofthe HD videos has therefore become a major limitation to its large-scaledeployment in video monitoring.

A video is a set of static pictures (or “frames”) arranged in a temporalsequence to store visual information. A video capture device (e.g., acamera) can be used to capture and store those pictures in a temporalsequence, and a video playback device (e.g., a television, a computer, asmartphone, a tablet computer, a video player, or any end-user terminalwith a function of display) can be used to display such pictures in thetemporal sequence. Also, in some applications, a video capturing devicecan transmit the captured video to the video playback device (e.g., acomputer with a monitor) in real-time, such as for monitoring,conferencing, or live broadcasting.

For reducing the storage space and the transmission bandwidth needed bysuch applications, the video can be compressed before storage andtransmission and decompressed before the display. The compression anddecompression can be implemented by software executed by a processor(e.g., a processor of a generic computer) or specialized hardware. Themodule for compression is generally referred to as an “encoder,” and themodule for decompression is generally referred to as a “decoder.” Theencoder and decoder can be collectively referred to as a “codec.” Theencoder and decoder can be implemented as any of a variety of suitablehardware, software, or a combination thereof. For example, the hardwareimplementation of the encoder and decoder can include circuitry, such asone or more microprocessors, digital signal processors (DSPs),application-specific integrated circuits (ASICs), field-programmablegate arrays (FPGAs), discrete logic, or any combinations thereof. Thesoftware implementation of the encoder and decoder can include programcodes, computer-executable instructions, firmware, or any suitablecomputer-implemented algorithm or process fixed in a computer-readablemedium. Video compression and decompression can be implemented byvarious algorithms or standards, such as MPEG-1, MPEG-2, MPEG-4, H.26xseries, or the like. In some applications, the codec can decompress thevideo from a first coding standard and re-compress the decompressedvideo using a second coding standard, in which case the codec can bereferred to as a “transcoder.”

The video encoding process can identify and keep useful information thatcan be used to reconstruct a picture and disregard unimportantinformation for the reconstruction. If the disregarded, unimportantinformation cannot be fully reconstructed, such an encoding process canbe referred to as “lossy.” Otherwise, it can be referred to as“lossless.” Most encoding processes are lossy, which is a tradeoff toreduce the needed storage space and the transmission bandwidth.

The useful information of a picture being encoded (referred to as a“current picture”) include changes with respect to a reference picture(e.g., a picture previously encoded and reconstructed). Such changes caninclude position changes, luminosity changes, or color changes of thepixels, among which the position changes are mostly concerned. Positionchanges of a group of pixels that represent an object can reflect themotion of the object between the reference picture and the currentpicture.

A picture coded without referencing another picture (i.e., it is its ownreference picture) is referred to as an “I-picture.” A picture codedusing a previous picture as a reference picture is referred to as a“P-picture.” A picture coded using both a previous picture and a futurepicture as reference pictures (i.e., the reference is “bi-directional”)is referred to as a “B-picture.”

As previously mentioned, video monitoring that uses HD videos faceschallenges of demands of high bandwidth and large storage. Foraddressing such challenges, the bitrate of the encoded video can bereduced. Among the I-, P-, and B-pictures, I-pictures have the highestbitrate. Because the backgrounds of most monitoring videos are nearlystatic, one way to reduce the overall bitrate of the encoded video canbe using fewer I-pictures for video encoding.

However, the improvement of using fewer I-pictures can be trivialbecause the I-pictures are typically not dominant in the encoded video.For example, in a typical video bitstream, the ratio of I-, B-, andP-pictures can be 1:20:9, in which the I-pictures can account for lessthan 10% of the total bitrate. In other words, in such an example, evenall I-pictures are removed, the reduced bitrate can be no more than 10%.

FIG. 1 illustrates structures of an example video sequence 100,consistent with embodiments of the disclosure. Video sequence 100 can bea live video or a video having been captured and archived. Video 100 canbe a real-life video, a computer-generated video (e.g., computer gamevideo), or a combination thereof (e.g., a real-life video withaugmented-reality effects). Video sequence 100 can be inputted from avideo capture device (e.g., a camera), a video archive (e.g., a videofile stored in a storage device) containing previously captured video,or a video feed interface (e.g., a video broadcast transceiver) toreceive video from a video content provider.

As shown in FIG. 1, video sequence 100 can include a series of picturesarranged temporally along a timeline, including pictures 102, 104, 106,and 108. Pictures 102-106 are continuous, and there are more picturesbetween pictures 106 and 108. In FIG. 1, picture 102 is an I-picture,the reference picture of which is picture 102 itself. Picture 104 is aP-picture, the reference picture of which is picture 102, as indicatedby the arrow. Picture 106 is a B-picture, the reference pictures ofwhich are pictures 104 and 108, as indicated by the arrows. In someembodiments, the reference picture of a picture (e.g., picture 104) canbe not immediately preceding or following the picture. For example, thereference picture of picture 104 can be a picture preceding picture 102.It should be noted that the reference pictures of pictures 102-106 areonly examples, and this disclosure does not limit embodiments of thereference pictures as the examples shown in FIG. 1.

Typically, video codecs do not encode or decode an entire picture at onetime due to the computing complexity of such tasks. Rather, they cansplit the picture into basic segments, and encode or decode the picturesegment by segment. Such basic segments are referred to as basicprocessing units (“BPUs”) in this disclosure. For example, structure 110in FIG. 1 shows an example structure of a picture of video sequence 100(e.g., any of pictures 102-108). In structure 110, a picture is dividedinto 4×4 basic processing units, the boundaries of which are shown asdash lines. In some embodiments, the basic processing units can bereferred to as “macroblocks” in some video coding standards (e.g., MPEGfamily, H.261, H.263, or H.264/AVC), or as “coding tree units” (“CTUs”)in some other video coding standards (e.g., H.265/HEVC or H.266/VVC).The basic processing units can have variable sizes in a picture, such as128×128, 64×64, 32×32, 16×16, 4×8, 16×32, or any arbitrary shape andsize of pixels. The sizes and shapes of the basic processing units canbe selected for a picture based on the balance of coding efficiency andlevels of details to be kept in the basic processing unit.

The basic processing units can be logical units, which can include agroup of different types of video data stored in a computer memory(e.g., in a video frame buffer). For example, a basic processing unit ofa color picture can include a luma component (Y) representing achromaticbrightness information, one or more chroma components (e.g., Cb and Cr)representing color information, and associated syntax elements, in whichthe luma and chroma components can have the same size of the basicprocessing unit. The luma and chroma components can be referred to as“coding tree blocks” (“CTBs”) in some video coding standards (e.g.,H.265/HEVC or H.266/VVC). Any operation performed to a basic processingunit can be repeatedly performed to each of its luma and chromacomponents.

Video coding has multiple stages of operations, examples of which willbe detailed in FIGS. 2A-2B and 3A-3B. For each stage, the size of thebasic processing units can still be too large for processing, and thuscan be further divided into segments referred to as “basic processingsub-units” in this disclosure. In some embodiments, the basic processingsub-units can be referred to as “blocks” in some video coding standards(e.g., MPEG family, H.261, H.263, or H.264/AVC), or as “coding units”(“CUs”) in some other video coding standards (e.g., H.265/HEVC orH.266/VVC). A basic processing sub-unit can have the same or smallersize than the basic processing unit. Similar to the basic processingunits, basic processing sub-units are also logical units, which caninclude a group of different types of video data (e.g., Y, Cb, Cr, andassociated syntax elements) stored in a computer memory (e.g., in avideo frame buffer). Any operation performed to a basic processingsub-unit can be repeatedly performed to each of its luma and chromacomponents. It should be noted that such division can be performed tofurther levels depending on processing needs. It should also be notedthat different stages can divide the basic processing units usingdifferent schemes.

For example, at a mode decision stage (an example of which will bedetailed in FIG. 2B), the encoder can decide what prediction mode (e.g.,intra-picture prediction or inter-picture prediction) to use for a basicprocessing unit, which can be too large to make such a decision. Theencoder can split the basic processing unit into multiple basicprocessing sub-units (e.g., CUs as in H.265/HEVC or H.266/VVC), anddecide a prediction type for each individual basic processing sub-unit.

For another example, at a prediction stage (an example of which will bedetailed in FIG. 2A), the encoder can perform prediction operation atthe level of basic processing sub-units (e.g., CUs). However, in somecases, a basic processing sub-unit can still be too large to process.The encoder can further split the basic processing sub-unit into smallersegments (e.g., referred to as “prediction blocks” or “PBs” inH.265/HEVC or H.266/VVC), at the level of which the prediction operationcan be performed.

For another example, at a transform stage (an example of which will bedetailed in FIG. 2A), the encoder can perform a transform operation forresidual basic processing sub-units (e.g., CUs). However, in some cases,a basic processing sub-unit can still be too large to process. Theencoder can further split the basic processing sub-unit into smallersegments (e.g., referred to as “transform blocks” or “TBs” in H.265/HEVCor H.266/VVC), at the level of which the transform operation can beperformed. It should be noted that the division schemes of the samebasic processing sub-unit can be different at the prediction stage andthe transform stage. For example, in H.265/HEVC or H.266/VVC, theprediction blocks and transform blocks of the same CU can have differentsizes and numbers.

In structure 110 of FIG. 1, basic processing unit 112 is further dividedinto 3×3 basic processing sub-units, the boundaries of which are shownas dotted lines. Different basic processing units of the same picturecan be divided into basic processing sub-units in different schemes.

In some implementations, to provide the capability of parallelprocessing and error resilience to video encoding and decoding, apicture can be divided into regions for processing, such that, for aregion of the picture, the encoding or decoding process can depend on noinformation from any other region of the picture. In other words, eachregion of the picture can be processed independently. By doing so, thecodec can process different regions of a picture in parallel, thusincreasing the coding efficiency. Also, when data of a region iscorrupted in the processing or lost in network transmission, the codeccan correctly encode or decode other regions of the same picture withoutreliance on the corrupted or lost data, thus providing the capability oferror resilience. In some video coding standards, a picture can bedivided into different types of regions. For example, H.265/HEVC andH.266/VVC provide two types of regions: “slices” and “tiles.” It shouldalso be noted that different pictures of video sequence 100 can havedifferent partition schemes for dividing a picture into regions.

For example, in FIG. 1, structure 110 is divided into three regions 114,116, and 118, the boundaries of which are shown as solid lines insidestructure 110. Region 114 includes four basic processing units. Each ofregions 116 and 118 includes six basic processing units. It should benoted that the basic processing units, basic processing sub-units, andregions of structure 110 in FIG. 1 are only examples, and thisdisclosure does not limit embodiments thereof.

FIG. 2A illustrates a schematic diagram of an example encoding process200A, consistent with embodiments of the disclosure. For example, theencoding process 200A can be performed by an encoder. As shown in FIG.2A, the encoder can encode video sequence 202 into video bitstream 228according to process 200A. Similar to video sequence 100 in FIG. 1,video sequence 202 can include a set of pictures (referred to as“original pictures”) arranged in a temporal order. Similar to structure110 in FIG. 1, each original picture of video sequence 202 can bedivided by the encoder into basic processing units, basic processingsub-units, or regions for processing. In some embodiments, the encodercan perform process 200A at the level of basic processing units for eachoriginal picture of video sequence 202. For example, the encoder canperform process 200A in an iterative manner, in which the encoder canencode a basic processing unit in one iteration of process 200A. In someembodiments, the encoder can perform process 200A in parallel forregions (e.g., regions 114-118) of each original picture of videosequence 202.

In FIG. 2A, the encoder can feed a basic processing unit (referred to asan “original BPU”) of an original picture of video sequence 202 toprediction stage 204 to generate prediction data 206 and predicted BPU208. The encoder can subtract predicted BPU 208 from the original BPU togenerate residual BPU 210. The encoder can feed residual BPU 210 totransform stage 212 and quantization stage 214 to generate quantizedtransform coefficients 216. The encoder can feed prediction data 206 andquantized transform coefficients 216 to binary coding stage 226 togenerate video bitstream 228. Components 202, 204, 206, 208, 210, 212,214, 216, 226, and 228 can be referred to as a “forward path.” Duringprocess 200A, after quantization stage 214, the encoder can feedquantized transform coefficients 216 to inverse quantization stage 218and inverse transform stage 220 to generate reconstructed residual BPU222. The encoder can add reconstructed residual BPU 222 to predicted BPU208 to generate prediction reference 224, which is used in predictionstage 204 for the next iteration of process 200A. Components 218, 220,222, and 224 of process 200A can be referred to as a “reconstructionpath.” The reconstruction path can be used to ensure that both theencoder and the decoder use the same reference data for prediction.

The encoder can perform process 200A iteratively to encode each originalBPU of the original picture (in the forward path) and generate predictedreference 224 for encoding the next original BPU of the original picture(in the reconstruction path). After encoding all original BPUs of theoriginal picture, the encoder can proceed to encode the next picture invideo sequence 202.

Referring to process 200A, the encoder can receive video sequence 202generated by a video capturing device (e.g., a camera). The term“receive” used herein can refer to receiving, inputting, acquiring,retrieving, obtaining, reading, accessing, or any action in any mannerfor inputting data.

At prediction stage 204, at a current iteration, the encoder can receivean original BPU and prediction reference 224, and perform a predictionoperation to generate prediction data 206 and predicted BPU 208.Prediction reference 224 can be generated from the reconstruction pathof the previous iteration of process 200A. The purpose of predictionstage 204 is to reduce information redundancy by extracting predictiondata 206 that can be used to reconstruct the original BPU as predictedBPU 208 from prediction data 206 and prediction reference 224.

Ideally, predicted BPU 208 can be identical to the original BPU.However, due to non-ideal prediction and reconstruction operations,predicted BPU 208 is generally slightly different from the original BPU.For recording such differences, after generating predicted BPU 208, theencoder can subtract it from the original BPU to generate residual BPU210. For example, the encoder can subtract values (e.g., greyscalevalues or RGB values) of pixels of predicted BPU 208 from values ofcorresponding pixels of the original BPU. Each pixel of residual BPU 210can have a residual value as a result of such subtraction between thecorresponding pixels of the original BPU and predicted BPU 208. Comparedwith the original BPU, prediction data 206 and residual BPU 210 can havefewer bits, but they can be used to reconstruct the original BPU withoutsignificant quality deterioration. Thus, the original BPU is compressed.

To further compress residual BPU 210, at transform stage 212, theencoder can reduce spatial redundancy of residual BPU 210 by decomposingit into a set of two-dimensional “base patterns,” each base patternbeing associated with a “transform coefficient.” The base patterns canhave the same size (e.g., the size of residual BPU 210). Each basepattern can represent a variation frequency (e.g., frequency ofbrightness variation) component of residual BPU 210. None of the basepatterns can be reproduced from any combinations (e.g., linearcombinations) of any other base patterns. In other words, thedecomposition can decompose variations of residual BPU 210 into afrequency domain. Such a decomposition is analogous to a discreteFourier transform of a function, in which the base patterns areanalogous to the base functions (e.g., trigonometry functions) of thediscrete Fourier transform, and the transform coefficients are analogousto the coefficients associated with the base functions.

Different transform algorithms can use different base patterns. Varioustransform algorithms can be used at transform stage 212, such as, forexample, a discrete cosine transform, a discrete sine transform, or thelike. The transform at transform stage 212 is invertible. That is, theencoder can restore residual BPU 210 by an inverse operation of thetransform (referred to as an “inverse transform”). For example, torestore a pixel of residual BPU 210, the inverse transform can bemultiplying values of corresponding pixels of the base patterns byrespective associated coefficients and adding the products to produce aweighted sum. For a video coding standard, both the encoder and decodercan use the same transform algorithm (thus the same base patterns).Thus, the encoder can record only the transform coefficients, from whichthe decoder can reconstruct residual BPU 210 without receiving the basepatterns from the encoder. Compared with residual BPU 210, the transformcoefficients can have fewer bits, but they can be used to reconstructresidual BPU 210 without significant quality deterioration. Thus,residual BPU 210 is further compressed.

The encoder can further compress the transform coefficients atquantization stage 214. In the transform process, different basepatterns can represent different variation frequencies (e.g., brightnessvariation frequencies). Because human eyes are generally better atrecognizing low-frequency variation, the encoder can disregardinformation of high-frequency variation without causing significantquality deterioration in decoding. For example, at quantization stage214, the encoder can generate quantized transform coefficients 216 bydividing each transform coefficient by an integer value (referred to asa “quantization parameter”) and rounding the quotient to its nearestinteger. After such an operation, some transform coefficients of thehigh-frequency base patterns can be converted to zero, and the transformcoefficients of the low-frequency base patterns can be converted tosmaller integers. The encoder can disregard the zero-value quantizedtransform coefficients 216, by which the transform coefficients arefurther compressed. The quantization process is also invertible, inwhich quantized transform coefficients 216 can be reconstructed to thetransform coefficients in an inverse operation of the quantization(referred to as “inverse quantization”).

Because the encoder disregards the remainders of such divisions in therounding operation, quantization stage 214 can be lossy. Typically,quantization stage 214 can contribute the most information loss inprocess 200A. The larger the information loss is, the fewer bits thequantized transform coefficients 216 can need. For obtaining differentlevels of information loss, the encoder can use different values of thequantization parameter or any other parameter of the quantizationprocess.

At binary coding stage 226, the encoder can encode prediction data 206and quantized transform coefficients 216 using a binary codingtechnique, such as, for example, entropy coding, variable length coding,arithmetic coding, Huffman coding, context-adaptive binary arithmeticcoding, or any other lossless or lossy compression algorithm. In someembodiments, besides prediction data 206 and quantized transformcoefficients 216, the encoder can encode other information at binarycoding stage 226, such as, for example, a prediction mode used atprediction stage 204, parameters of the prediction operation, atransform type at transform stage 212, parameters of the quantizationprocess (e.g., quantization parameters), an encoder control parameter(e.g., a bitrate control parameter), or the like. The encoder can usethe output data of binary coding stage 226 to generate video bitstream228. In some embodiments, video bitstream 228 can be further packetizedfor network transmission.

Referring to the reconstruction path of process 200A, at inversequantization stage 218, the encoder can perform inverse quantization onquantized transform coefficients 216 to generate reconstructed transformcoefficients. At inverse transform stage 220, the encoder can generatereconstructed residual BPU 222 based on the reconstructed transformcoefficients. The encoder can add reconstructed residual BPU 222 topredicted BPU 208 to generate prediction reference 224 that is to beused in the next iteration of process 200A.

It should be noted that other variations of the process 200A can be usedto encode video sequence 202. In some embodiments, stages of process200A can be performed by the encoder in different orders. In someembodiments, one or more stages of process 200A can be combined into asingle stage. In some embodiments, a single stage of process 200A can bedivided into multiple stages. For example, transform stage 212 andquantization stage 214 can be combined into a single stage. In someembodiments, process 200A can include additional stages. In someembodiments, process 200A can omit one or more stages in FIG. 2A.

FIG. 2B illustrates a schematic diagram of another example encodingprocess 200B, consistent with embodiments of the disclosure. Process200B can be modified from process 200A. For example, process 200B can beused by an encoder conforming to a hybrid video coding standard (e.g.,H.26x series). Compared with process 200A, the forward path of process200B additionally includes mode decision stage 230 and dividesprediction stage 204 into spatial prediction stage 2042 and temporalprediction stage 2044. The reconstruction path of process 200Badditionally includes loop filter stage 232 and buffer 234.

Generally, prediction techniques can be categorized into two types:spatial prediction and temporal prediction. Spatial prediction (e.g., anintra-picture prediction or “intra prediction”) can use pixels from oneor more already coded neighboring BPUs in the same picture to predictthe current BPU. That is, prediction reference 224 in the spatialprediction can include the neighboring BPUs. The spatial prediction canreduce the inherent spatial redundancy of the picture. Temporalprediction (e.g., an inter-picture prediction or “inter prediction”) canuse regions from one or more already coded pictures to predict thecurrent BPU. That is, prediction reference 224 in the temporalprediction can include the coded pictures. The temporal prediction canreduce the inherent temporal redundancy of the pictures.

Referring to process 200B, in the forward path, the encoder performs theprediction operation at spatial prediction stage 2042 and temporalprediction stage 2044. For example, at spatial prediction stage 2042,the encoder can perform the intra prediction. For an original BPU of apicture being encoded, prediction reference 224 can include one or moreneighboring BPUs that have been encoded (in the forward path) andreconstructed (in the reconstructed path) in the same picture. Theencoder can generate predicted BPU 208 by extrapolating the neighboringBPUs. The extrapolation technique can include, for example, a linearextrapolation or interpolation, a polynomial extrapolation orinterpolation, or the like. In some embodiments, the encoder can performthe extrapolation at the pixel level, such as by extrapolating values ofcorresponding pixels for each pixel of predicted BPU 208. Theneighboring BPUs used for extrapolation can be located with respect tothe original BPU from various directions, such as in a verticaldirection (e.g., on top of the original BPU), a horizontal direction(e.g., to the left of the original BPU), a diagonal direction (e.g., tothe down-left, down-right, up-left, or up-right of the original BPU), orany direction defined in the used video coding standard. For the intraprediction, prediction data 206 can include, for example, locations(e.g., coordinates) of the used neighboring BPUs, sizes of the usedneighboring BPUs, parameters of the extrapolation, a direction of theused neighboring BPUs with respect to the original BPU, or the like.

For another example, at temporal prediction stage 2044, the encoder canperform the inter prediction. For an original BPU of a current picture,prediction reference 224 can include one or more pictures (referred toas “reference pictures”) that have been encoded (in the forward path)and reconstructed (in the reconstructed path). In some embodiments, areference picture can be encoded and reconstructed BPU by BPU. Forexample, the encoder can add reconstructed residual BPU 222 to predictedBPU 208 to generate a reconstructed BPU. When all reconstructed BPUs ofthe same picture are generated, the encoder can generate a reconstructedpicture as a reference picture. The encoder can perform an operation of“motion estimation” to search for a matching region in a scope (referredto as a “search window”) of the reference picture. The location of thesearch window in the reference picture can be determined based on thelocation of the original BPU in the current picture. For example, thesearch window can be centered at a location having the same coordinatesin the reference picture as the original BPU in the current picture andcan be extended out for a predetermined distance. When the encoderidentifies (e.g., by using a pel-recursive algorithm, a block-matchingalgorithm, or the like) a region similar to the original BPU in thesearch window, the encoder can determine such a region as the matchingregion. The matching region can have different dimensions (e.g., beingsmaller than, equal to, larger than, or in a different shape) from theoriginal BPU. Because the reference picture and the current picture aretemporally separated in the timeline (e.g., as shown in FIG. 1), it canbe deemed that the matching region “moves” to the location of theoriginal BPU as time goes by. The encoder can record the direction anddistance of such a motion as a “motion vector.” When multiple referencepictures are used (e.g., as picture 106 in FIG. 1), the encoder cansearch for a matching region and determine its associated motion vectorfor each reference picture. In some embodiments, the encoder can assignweights to pixel values of the matching regions of respective matchingreference pictures.

The motion estimation can be used to identify various types of motions,such as, for example, translations, rotations, zooming, or the like. Forinter prediction, prediction data 206 can include, for example,locations (e.g., coordinates) of the matching region, the motion vectorsassociated with the matching region, the number of reference pictures,weights associated with the reference pictures, or the like.

For generating predicted BPU 208, the encoder can perform an operationof “motion compensation.” The motion compensation can be used toreconstruct predicted BPU 208 based on prediction data 206 (e.g., themotion vector) and prediction reference 224. For example, the encodercan move the matching region of the reference picture according to themotion vector, in which the encoder can predict the original BPU of thecurrent picture. When multiple reference pictures are used (e.g., aspicture 106 in FIG. 1), the encoder can move the matching regions of thereference pictures according to the respective motion vectors andaverage pixel values of the matching regions. In some embodiments, ifthe encoder has assigned weights to pixel values of the matching regionsof respective matching reference pictures, the encoder can add aweighted sum of the pixel values of the moved matching regions.

In some embodiments, the inter prediction can be unidirectional orbidirectional. Unidirectional inter predictions can use one or morereference pictures in the same temporal direction with respect to thecurrent picture. For example, picture 104 in FIG. 1 is a unidirectionalinter-predicted picture, in which the reference picture (i.e., picture102) precedes picture 104. Bidirectional inter predictions can use oneor more reference pictures at both temporal directions with respect tothe current picture. For example, picture 106 in FIG. 1 is abidirectional inter-predicted picture, in which the reference pictures(i.e., pictures 104 and 108) are at both temporal directions withrespect to picture 104.

Still referring to the forward path of process 200B, after spatialprediction 2042 and temporal prediction stage 2044, at mode decisionstage 230, the encoder can select a prediction mode (e.g., one of theintra prediction or the inter prediction) for the current iteration ofprocess 200B. For example, the encoder can perform a rate-distortionoptimization technique, in which the encoder can select a predictionmode to minimize a value of a cost function depending on a bit rate of acandidate prediction mode and distortion of the reconstructed referencepicture under the candidate prediction mode. Depending on the selectedprediction mode, the encoder can generate the corresponding predictedBPU 208 and predicted data 206.

In the reconstruction path of process 200B, if intra prediction mode hasbeen selected in the forward path, after generating prediction reference224 (e.g., the current BPU that has been encoded and reconstructed inthe current picture), the encoder can directly feed prediction reference224 to spatial prediction stage 2042 for later usage (e.g., forextrapolation of a next BPU of the current picture). If the interprediction mode has been selected in the forward path, after generatingprediction reference 224 (e.g., the current picture in which all BPUshave been encoded and reconstructed), the encoder can feed predictionreference 224 to loop filter stage 232, at which the encoder can apply aloop filter to prediction reference 224 to reduce or eliminatedistortion (e.g., blocking artifacts) introduced by the interprediction. The encoder can apply various loop filter techniques at loopfilter stage 232, such as, for example, deblocking, sample adaptiveoffsets, adaptive loop filters, or the like. The loop-filtered referencepicture can be stored in buffer 234 (or “decoded picture buffer”) forlater use (e.g., to be used as an inter-prediction reference picture fora future picture of video sequence 202). The encoder can store one ormore reference pictures in buffer 234 to be used at temporal predictionstage 2044. In some embodiments, the encoder can encode parameters ofthe loop filter (e.g., a loop filter strength) at binary coding stage226, along with quantized transform coefficients 216, prediction data206, and other information.

FIG. 3A illustrates a schematic diagram of an example decoding process300A, consistent with embodiments of the disclosure. Process 300A can bea decompression process corresponding to the compression process 200A inFIG. 2A. In some embodiments, process 300A can be similar to thereconstruction path of process 200A. A decoder can decode videobitstream 228 into video stream 304 according to process 300A. Videostream 304 can be very similar to video sequence 202. However, due tothe information loss in the compression and decompression process (e.g.,quantization stage 214 in FIGS. 2A-2B), generally, video stream 304 isnot identical to video sequence 202. Similar to processes 200A and 200Bin FIGS. 2A-2B, the decoder can perform process 300A at the level ofbasic processing units (BPUs) for each picture encoded in videobitstream 228. For example, the decoder can perform process 300A in aniterative manner, in which the decoder can decode a basic processingunit in one iteration of process 300A. In some embodiments, the decodercan perform process 300A in parallel for regions (e.g., regions 114-118)of each picture encoded in video bitstream 228.

In FIG. 3A, the decoder can feed a portion of video bitstream 228associated with a basic processing unit (referred to as an “encodedBPU”) of an encoded picture to binary decoding stage 302. At binarydecoding stage 302, the decoder can decode the portion into predictiondata 206 and quantized transform coefficients 216. The decoder can feedquantized transform coefficients 216 to inverse quantization stage 218and inverse transform stage 220 to generate reconstructed residual BPU222. The decoder can feed prediction data 206 to prediction stage 204 togenerate predicted BPU 208. The decoder can add reconstructed residualBPU 222 to predicted BPU 208 to generate predicted reference 224. Insome embodiments, predicted reference 224 can be stored in a buffer(e.g., a decoded picture buffer in a computer memory). The decoder canfeed predicted reference 224 to prediction stage 204 for performing aprediction operation in the next iteration of process 300A.

The decoder can perform process 300A iteratively to decode each encodedBPU of the encoded picture and generate predicted reference 224 forencoding the next encoded BPU of the encoded picture. After decoding allencoded BPUs of the encoded picture, the decoder can output the pictureto video stream 304 for display and proceed to decode the next encodedpicture in video bitstream 228.

At binary decoding stage 302, the decoder can perform an inverseoperation of the binary coding technique used by the encoder (e.g.,entropy coding, variable length coding, arithmetic coding, Huffmancoding, context-adaptive binary arithmetic coding, or any other losslesscompression algorithm). In some embodiments, besides prediction data 206and quantized transform coefficients 216, the decoder can decode otherinformation at binary decoding stage 302, such as, for example, aprediction mode, parameters of the prediction operation, a transformtype, parameters of the quantization process (e.g., quantizationparameters), an encoder control parameter (e.g., a bitrate controlparameter), or the like. In some embodiments, if video bitstream 228 istransmitted over a network in packets, the decoder can depacketize videobitstream 228 before feeding it to binary decoding stage 302.

FIG. 3B illustrates a schematic diagram of another example decodingprocess 300B, consistent with embodiments of the disclosure. Process300B can be modified from process 300A. For example, process 300B can beused by a decoder conforming to a hybrid video coding standard (e.g.,H.26x series). Compared with process 300A, process 300B additionallydivides prediction stage 204 into spatial prediction stage 2042 andtemporal prediction stage 2044, and additionally includes loop filterstage 232 and buffer 234.

In process 300B, for an encoded basic processing unit (referred to as a“current BPU”) of an encoded picture (referred to as a “currentpicture”) that is being decoded, prediction data 206 decoded from binarydecoding stage 302 by the decoder can include various types of data,depending on what prediction mode was used to encode the current BPU bythe encoder. For example, if intra prediction was used by the encoder toencode the current BPU, prediction data 206 can include a predictionmode indicator (e.g., a flag value) indicative of the intra prediction,parameters of the intra prediction operation, or the like. Theparameters of the intra prediction operation can include, for example,locations (e.g., coordinates) of one or more neighboring BPUs used as areference, sizes of the neighboring BPUs, parameters of extrapolation, adirection of the neighboring BPUs with respect to the original BPU, orthe like. For another example, if inter prediction was used by theencoder to encode the current BPU, prediction data 206 can include aprediction mode indicator (e.g., a flag value) indicative of the interprediction, parameters of the inter prediction operation, or the like.The parameters of the inter prediction operation can include, forexample, the number of reference pictures associated with the currentBPU, weights respectively associated with the reference pictures,locations (e.g., coordinates) of one or more matching regions in therespective reference pictures, one or more motion vectors respectivelyassociated with the matching regions, or the like.

Based on the prediction mode indicator, the decoder can decide whetherto perform a spatial prediction (e.g., the intra prediction) at spatialprediction stage 2042 or a temporal prediction (e.g., the interprediction) at temporal prediction stage 2044. The details of performingsuch spatial prediction or temporal prediction are described in FIG. 2Band will not be repeated hereinafter. After performing such spatialprediction or temporal prediction, the decoder can generate predictedBPU 208. The decoder can add predicted BPU 208 and reconstructedresidual BPU 222 to generate prediction reference 224, as described inFIG. 3A.

In process 300B, the decoder can feed predicted reference 224 to spatialprediction stage 2042 or temporal prediction stage 2044 for performing aprediction operation in the next iteration of process 300B. For example,if the current BPU is decoded using the intra prediction at spatialprediction stage 2042, after generating prediction reference 224 (e.g.,the decoded current BPU), the decoder can directly feed predictionreference 224 to spatial prediction stage 2042 for later usage (e.g.,for extrapolation of a next BPU of the current picture). If the currentBPU is decoded using the inter prediction at temporal prediction stage2044, after generating prediction reference 224 (e.g., a referencepicture in which all BPUs have been decoded), the encoder can feedprediction reference 224 to loop filter stage 232 to reduce or eliminatedistortion (e.g., blocking artifacts). The decoder can apply a loopfilter to prediction reference 224, in a way as described in FIG. 2B.The loop-filtered reference picture can be stored in buffer 234 (e.g., adecoded picture buffer in a computer memory) for later use (e.g., to beused as an inter-prediction reference picture for a future encodedpicture of video bitstream 228). The decoder can store one or morereference pictures in buffer 234 to be used at temporal prediction stage2044. In some embodiments, when the prediction mode indicator ofprediction data 206 indicates that inter prediction was used to encodethe current BPU, prediction data can further include parameters of theloop filter (e.g., a loop filter strength).

FIG. 4 is a block diagram of an example apparatus 400 for encoding ordecoding a video, consistent with embodiments of the disclosure. Asshown in FIG. 4, apparatus 400 can include processor 402. When processor402 executes instructions described herein, apparatus 400 can become aspecialized machine for video encoding or decoding. Processor 402 can beany type of circuitry capable of manipulating or processing information.For example, processor 402 can include any combination of any number ofa central processing unit (or “CPU”), a graphics processing unit (or“GPU”), a neural processing unit (“NPU”), a microcontroller unit(“MCU”), an optical processor, a programmable logic controller, amicrocontroller, a microprocessor, a digital signal processor, anintellectual property (IP) core, a Programmable Logic Array (PLA), aProgrammable Array Logic (PAL), a Generic Array Logic (GAL), a ComplexProgrammable Logic Device (CPLD), a Field-Programmable Gate Array(FPGA), a System On Chip (SoC), an Application-Specific IntegratedCircuit (ASIC), or the like. In some embodiments, processor 402 can alsobe a set of processors grouped as a single logical component. Forexample, as shown in FIG. 4, processor 402 can include multipleprocessors, including processor 402 a, processor 402 b, and processor402 n.

Apparatus 400 can also include memory 404 configured to store data(e.g., a set of instructions, computer codes, intermediate data, or thelike). For example, as shown in FIG. 4, the stored data can includeprogram instructions (e.g., program instructions for implementing thestages in processes 200A, 200B, 300A, or 300B) and data for processing(e.g., video sequence 202, video bitstream 228, or video stream 304).Processor 402 can access the program instructions and data forprocessing (e.g., via bus 410), and execute the program instructions toperform an operation or manipulation on the data for processing. Memory404 can include a high-speed random-access storage device or anon-volatile storage device. In some embodiments, memory 404 can includeany combination of any number of a random-access memory (RAM), aread-only memory (ROM), an optical disc, a magnetic disk, a hard drive,a solid-state drive, a flash drive, a security digital (SD) card, amemory stick, a compact flash (CF) card, or the like. Memory 404 canalso be a group of memories (not shown in FIG. 4) grouped as a singlelogical component.

Bus 410 can be a communication device that transfers data betweencomponents inside apparatus 400, such as an internal bus (e.g., aCPU-memory bus), an external bus (e.g., a universal serial bus port, aperipheral component interconnect express port), or the like.

For ease of explanation without causing ambiguity, processor 402 andother data processing circuits are collectively referred to as a “dataprocessing circuit” in this disclosure. The data processing circuit canbe implemented entirely as hardware, or as a combination of software,hardware, or firmware. In addition, the data processing circuit can be asingle independent module or can be combined entirely or partially intoany other component of apparatus 400.

Apparatus 400 can further include network interface 406 to provide wiredor wireless communication with a network (e.g., the Internet, anintranet, a local area network, a mobile communications network, or thelike). In some embodiments, network interface 406 can include anycombination of any number of a network interface controller (NIC), aradio frequency (RF) module, a transponder, a transceiver, a modem, arouter, a gateway, a wired network adapter, a wireless network adapter,a Bluetooth adapter, an infrared adapter, an near-field communication(“NFC”) adapter, a cellular network chip, or the like.

In some embodiments, optionally, apparatus 400 can further includeperipheral interface 408 to provide a connection to one or moreperipheral devices. As shown in FIG. 4, the peripheral device caninclude, but is not limited to, a cursor control device (e.g., a mouse,a touchpad, or a touchscreen), a keyboard, a display (e.g., acathode-ray tube display, a liquid crystal display, or a light-emittingdiode display), a video input device (e.g., a camera or an inputinterface coupled to a video archive), or the like.

It should be noted that video codecs (e.g., a codec performing process200A, 200B, 300A, or 300B) can be implemented as any combination of anysoftware or hardware modules in apparatus 400. For example, some or allstages of process 200A, 200B, 300A, or 300B can be implemented as one ormore software modules of apparatus 400, such as program instructionsthat can be loaded into memory 404. For another example, some or allstages of process 200A, 200B, 300A, or 300B can be implemented as one ormore hardware modules of apparatus 400, such as a specialized dataprocessing circuit (e.g., an FPGA, an ASIC, an NPU, or the like).

The present disclosure provides block partition methods for use inmotion prediction. It is contemplated that the disclosed methods can beperformed by either an encoder or a decoder.

A triangle partition mode is supported for inter prediction. Thetriangle partition mode can be applied to blocks that are 8×8 or largerand are coded in a triangle skip or merge mode. A triangle skip/mergemode is signalled in parallel to a regular merge mode, an MMVD mode, acombined inter and intra prediction (CIIP) mode, or a subblock mergemode.

When the triangle partition mode is used, a block can be split evenlyinto two triangle-shaped partitions, using either the diagonal split orthe anti-diagonal split (FIG. 5). Each triangle partition in the blockis inter-predicted using its own motion. Only uni-prediction is allowedfor each partition. In other words, each partition has one motion vectorand one reference index. The uni-prediction motion constraint is appliedto ensure that same as the conventional bi-prediction, only two motioncompensated predictions are needed for each block. The uni-predictionmotion for each partition is derived directly from the merge candidatelist constructed for extended merge prediction, and the selection of auni-prediction motion from a given merge candidate in the list isaccording to the procedure described below.

If the triangle partition mode is used for a current block, then a flagindicating the direction of the triangle partition (diagonal oranti-diagonal) and two merge indices (one for each partition) arefurther signalled. After predicting each of the triangle partitions, thesample values along the diagonal or anti-diagonal edge are adjustedusing a blending processing with adaptive weights. This is theprediction signal for the whole block, and a process for transformingand quantization can be applied to the whole block as in otherprediction modes. It is noted that the sub-block transform (SBT) modecannot be applied to the block coded using the triangle partition mode.The motion field of a block predicted using the triangle partition modecan be stored in 4×4 subblocks.

Uni-prediction candidate list construction for the triangle partitionmode is described below.

Given a merge candidate index, the uni-prediction motion vector isderived from the merge candidate list constructed for extended mergeprediction, as exemplified in FIG. 6. For a candidate in the list, itsLX (L0 or L1) motion vector with X equal to the parity of the mergecandidate index value (i.e., X=0 or 1), is used as the uni-predictionmotion vector for triangle partition mode. These motion vectors aremarked with “x” in FIG. 6. When a corresponding LX motion vector doesnot exist, the L(1−X) motion vector of the same candidate in theextended merge prediction candidate list is used as the uni-predictionmotion vector for triangle partition mode.

Blending along the triangle partition edge will be described below.

After predicting each triangle partition using its own motion, blendingis applied to the two prediction signals to derive samples around thediagonal edge or the anti-diagonal edge. The following weights are usedin the blending process:

{7/8, 6/8, 5/8, 4/8, 3/8, 2/8, 1/8} for luma and {6/8, 4/8, 2/8} forchroma, as shown in FIG. 7.

The weight of each of the luma and chroma samples within a blockpredicted using triangle partition mode is calculated using thefollowing equations:

-   -   the ratio

$R = {{\left( {{CuW}_{L} > {CuH}_{L}} \right)?\frac{{CuW}_{L}}{{CuH}_{L}}}\text{:}\frac{{CuH}_{L}}{{CuW}_{L}}}$

-   -   the split direction splitDir is set to 0 if the block is split        from a first direction (e.g., from a top-left corner to a        bottom-right corner). Otherwise, splitDir is set to 1 if the        block is split from a second direction (e.g., from a top-right        corner to a bottom-left corner).

${{{sampleWeight}_{L}\lbrack x\rbrack}\lbrack y\rbrack} = \left\{ {{\begin{matrix}{{clip}\; 3\left( {0,{{8\frac{x}{R}} - y + 4}} \right)} & {{{if}\mspace{14mu}{splitDir}} = {{0\mspace{14mu}{and}\mspace{14mu}{CuW}_{L}} > {CuH}_{L}}} \\{{clip}\; 3\left( {0,8,{x - \frac{y}{R} + 4}} \right)} & {{{if}\mspace{14mu}{splitDir}} = {{0\mspace{14mu}{and}\mspace{14mu}{CuW}_{L}} \leq {CuH}_{L}}} \\{{clip}\; 3\left( {0,8,{{CuH}_{L} - 1 - \frac{x}{R} - y + 4}} \right)} & {{{if}\mspace{14mu}{splitDir}} = {{1\mspace{14mu}{and}\mspace{14mu}{CuW}_{L}} > {CuH}_{L}}} \\{{clip}\; 3\left( {0,8,{{CuW}_{L} - 1 - x - \frac{y}{R} + 4}} \right)} & {{{if}\mspace{14mu}{splitDir}} = {{1\mspace{14mu}{and}\mspace{14mu}{CuW}_{L}} \leq {CuH}_{L}}}\end{matrix}{{{sampleWeight}_{C}\lbrack x\rbrack}\lbrack y\rbrack}} = \left\{ \begin{matrix}{{clip}\; 3\left( {0,{{4\frac{x}{R}} - y + 2}} \right) \times 2} & {{{if}\mspace{14mu}{splitDir}} = {{0\mspace{14mu}{and}\mspace{14mu}{CuW}_{C}} > {CuH}_{C}}} \\{{clip}\; 3\left( {0,4,{x - \frac{y}{R} + 2}} \right) \times 2} & {{{if}\mspace{14mu}{splitDir}} = {{0\mspace{14mu}{and}\mspace{14mu}{CuW}_{C}} \leq {CuH}_{C}}} \\{{clip}\; 3\left( {0,4,{{CuH}_{C} - 1 - \frac{x}{R} - y + 2}} \right) \times 2} & {{{if}\mspace{14mu}{splitDir}} = {{1\mspace{14mu}{and}\mspace{14mu}{CuW}_{C}} > {CuH}_{C}}} \\{{clip}\; 3\left( {0,4,{{CuW}_{C} - 1 - x - \frac{y}{R} + 2}} \right) \times 2} & {{{if}\mspace{14mu}{splitDir}} = {{1\mspace{14mu}{and}\mspace{14mu}{CuW}_{C}} \leq {CuH}_{C}}}\end{matrix} \right.} \right.$

where the sampleWeight_(L) represents the weight map for luma samples,sampleWeight_(C) represents the weight map for chroma samples, (x,y)represents the position of luma/chroma sample, (CuW_(L),CuH_(L))represents the block width and height in luma samples, and (CuW_(C),CuH_(C)) represents the block width and height in chroma samples.

Then, motion field storage in the triangle partition mode will bedescribed below.

The motion vectors of a block coded in the triangle partition mode arestored in 4×4 subblocks. Depending on the position of each 4×4 subblock,either uni-prediction or bi-prediction motion vectors are stored. DenoteMv1 and Mv2 as uni-prediction motion vectors for partition 1 andpartition 2 in FIG. 5, respectively. If a 4×4 subblock is located in theun-predicted area, either Mv1 or Mv2 is stored for that 4×4 subblock.Otherwise, if the 4×4 subblock is located in the bi-predicted area, abi-prediction motion vector is stored. The bi-prediction motion vectoris derived from Mv1 and Mv2 according to the following process.

1. If Mv1 and Mv2 are from different reference picture lists (one fromL0 and the other from L1), then Mv1 and Mv2 are simply combined to formthe bi-prediction motion vector.

2. Otherwise, if Mv1 and Mv2 are from the same list, instead ofbi-prediction motion, only uni-prediction motion Mv2 is stored.

It is noted that, when all the samples within a 4×4 subblock areweighted, the 4×4 subblock is considered to be in the bi-predicted area.Otherwise, the 4×4 subblock is considered to be in the uni-predictedarea. Examples of the bi-predicted area (which is the shadow area) andthe uni-predicted area are shown in FIG. 8.

The following equations may be used to determine whether a 4×4 subblockis located in the bi-predicted area:

-   -   the ratio

$R = {{\left( {{CuW_{L}} > {CuH_{L}}} \right)?\frac{CuW_{L}}{CuH_{L}}}:\frac{CuH_{L}}{CuW_{L}}}$

-   -   the split direction splitDir is set to 0 if the block is split        from a top-left corner to a bottom-right corner. Otherwise,        splitDir is set to 1 if the block is split from a top-right        corner to a bottom-left corner.    -   the variable

${minSB} = {{\min\mspace{11mu}\left( {\frac{cuW_{L}}{4},\frac{{CuH}_{L}}{4}} \right)} - 1}$

-   -   if CuW_(L)>cuH_(L) and splitDir=0,        -   if

${\frac{x\text{/}4}{R} = \frac{y}{4}},$

-   -   -    the 4×4 subblock is located in the bi-predicted area;        -   otherwise, the 4×4 subblock is located in the uni-predicted            area;

    -   if CuW_(L)≤CuH_(L) and splitDir=0,        -   if

${\frac{x}{4} = \frac{y\text{/}4}{R}},$

-   -   -    the 4×4 subblock is located in the bi-predicted area;        -   otherwise, the 4×4 subblock is located in the uni-predicted            area;

    -   if CuW_(L)>CuH_(L) and splitDir=1,        -   if

${{\frac{x\text{/}4}{R} + \frac{y}{4}} = {minSb}},$

-   -   -    the 4×4 subblock is located in the bi-predicted area;        -   otherwise, the 4×4 subblock is located in the uni-predicted            area;

    -   if CuW_(L)≤CuH_(L) and splitDir=1,        -   if

${{\frac{x}{4} + \frac{y\text{/}4}{R}} = {minSb}},$

-   -   -    the 4×4 subblock is located in the bi-predicted area;        -   otherwise, the 4×4 subblock is located in the uni-predicted            area;            where the (x,y) represents the position of the top-left luma            sample of the 4×4 subblock and (CuW_(L),CuH_(L)) represents            the block width and block height in luma samples.

Exemplary syntax structures for the triangle partition mode aredescribed below.

Exemplary syntax structures of a merge mode are shown in FIGS. 9-10,respectively. The CIIP flag shown in the figures is used to indicatewhether a block is predicted using triangle partition mode.

Geometric partition mode consistent with the present disclosure isdescribed as below.

In the disclosed embodiments, the geometric partition mode can also beused to code video content. In the geometric partition mode, a block issplit into two partitions, and the two partitions can be in eitherrectangular or non-rectangular shape, as shown in FIG. 11. Then the twopartitions are inter-predicted with its own motion vectors. Theuni-prediction motion is derived using the same process descried abovewith reference to FIG. 6. After predicting each of the geometricpartitions, similar to the process used in triangle partition mode, thesample values along the partitioning edge are adjusted using a blendingprocessing with adaptive weights. This is the prediction signal for thewhole block, and transform and quantization process can be applied tothe whole block as in other prediction modes. It is noted that the SBTmode can be applied to a block coded using geometric partition mode.Finally, the motion field of a block predicted using the geometricpartition mode can be stored in 4×4 subblocks. The benefit of geometricpartition mode is that it provides more flexible partitioning method formotion compensation.

The geometric partition mode is only applied to blocks whose width andheight are both larger than or equal to 8 and the ratio of max(width,height)/min(width, height) is smaller than or equal to 4, and are codedin a geometric skip or merge mode. A geometric partition mode issignaled for each block in parallel to a regular merge mode, MMVD mode,CIIP mode, a subblock merge mode, or a triangle partition mode. Whenthis mode is used for a current block, a geometric partition mode indexindicating which one out of 140 partitioning method (32 quantizedangle+5 quantized distance) is used to split the current block and twomerge indices are further signaled. It is noted that the total number ofgeometric partitioning submodes may be one of 140 (16 quantized angle+9quantized distance), 108 (16 quantized angle+7 quantized distance), 80(12 quantized angle+7 quantized distance) and 64 (10 quantized angle+7quantized distance) depending on different setting.

Blending along the geometric partition edge will be discussed as below.After predicting each geometric partition using its own motion, ablending process is applied to the two prediction signals to derivesamples around the partition edge. In some embodiments, the weight foreach luma sample is calculated using the following equations.

distFromLine=((x<<1)+1)×Dis[displacementX]+((y<<1)+1)×Dis[displacementY]−rho

distScaled=Min((abs(distFromLine))>>4,14)

sampleWeight_(L)[x][y]=distFromLine≤0?GeoFilter[distScaled]:8−GeoFilter[distScaled]

where (x,y) represents the position of each luma sample, Dis[ ] andGeoFilter[ ] are two look-up tables as shown in Table 12 and Tables13A-13B of FIGS. 12-13, respectively

The parameters displacementX, displacementY, and rho are calculated asfollows:

displacementX=angleIdx

displacementY=(displancementX+NumAngles>>2)% NumAngles

rho=distanceIdx×stepSize×scaleStep+CuW×Dis[displacementX]+CuH×Dis[displacementY]

stepSize=stepDis+64

scaleStep=(wIdx≥hIdx)?(1<<hIdx):(1<<wIdx)

wIdx=log 2(CuW)−3

hIdx=log 2(CuH)−3

whRatio=(wIdx≥hIdx)?(wIdx−hIdx):(hIdx−wIdx)

${angleN} = \left\{ \begin{matrix}{angleIdx} & {{angleIdx} > {0\mspace{14mu}{and}\mspace{14mu}{angleIdx}} \leq 8} \\{16 - {angleIdx}} & {{angleIdx} > {8\mspace{14mu}{and}\mspace{14mu}{angleIdx}} \leq 16} \\{{angleIdx} - 16} & {{angleIdx} > {16\mspace{14mu}{and}\mspace{14mu}{angleIdx}} \leq 24} \\{32 - {angleIdx}} & {otherwise}\end{matrix} \right.$angleN=(wIdx≥hIdx)?8−angleN:angleN

where (CuW, CuH) is the block width and height in luma samples,NumAngles is set to 32, angleIdx and distanceIdx are derived from Table14 of FIG. 14, and stepDis is derived from Table 15A of FIG. 15A.

In some embodiments, the parameters displacementX, displacementY, andrho can also be calculated as follows.

displacementX=angleIdx

displacementY=(displancementX+NumAngles>>2)% NumAngles

rho=distanceIdx×(stepSize<<scaleStep)+Dis[displacementX]<<wIdx+Dis[displacementY]<<hIdx

stepSize=stepDis+77

scaleStep=(wIdx≥hIdx)?hIdx−3:wIdx−3

wIdx=log 2(CuW)

hIdx=log 2(CuH)

whRatio=(wIdx≥hIdx)?(wIdx−hIdx):(hIdx−wIdx)

${angleN} = \left\{ \begin{matrix}{{angleIdx}\mspace{11mu}\%\mspace{11mu} 8} & {{{wIdx} \geq {{hIdx}\mspace{14mu}{and}\mspace{14mu}\left( {{angleIdx} ⪢ 3} \right)\mspace{11mu}\%\mspace{11mu} 1}} = 1} \\{8 - \left( {{angleIdx}\mspace{11mu}\%\mspace{11mu} 8} \right)} & {{{wIdx} \geq {{hIdx}\mspace{14mu}{and}\mspace{14mu}\left( {{angleIdx} ⪢ 3} \right)\mspace{11mu}\%\mspace{11mu} 1}} = 0} \\{8 - \left( {{angleIdx}\mspace{11mu}\%\mspace{11mu} 8} \right)} & {{{wIdx} < {{hIdx}\mspace{14mu}{and}\mspace{14mu}\left( {{angleIdx} ⪢ 3} \right)\mspace{11mu}\%\mspace{11mu} 1}} = 0} \\{{angleIdx}\mspace{11mu}\%\mspace{11mu} 8} & {{{wIdx} < {{hIdx}\mspace{14mu}{and}\mspace{14mu}\left( {{angleIdx} ⪢ 3} \right)\mspace{11mu}\%\mspace{11mu} 1}} = 0}\end{matrix} \right.$

where (CuW,CuH) is the block width and height in luma samples, NumAnglesis set to 32, and stepDis is derived from Table 15B of FIG. 15B. TheangleIdx and distanceIdx are derived from Table 15C, Table 15D, Table15E, and Table 15F of FIGS. 15C-15F, when the total number of geometricpartitioning submodes is set to 140, 108, 80 and 64, respectively.

The weight for chroma sample is subsampled from the top-left lumasamples weights of each 2×2 luma subblock e.g., for YUV 4:2:0 videoformat.

Motion field storage in the geometric partition mode will be describedbelow.

The motion vectors of a block coded in the geometric partition mode arestored in 4×4 subblocks. For each 4×4 subblock, either uni-prediction orbi-prediction motion vectors are stored. The derivation process forbi-prediction motion is the same as the process described above. Todetermine whether uni-prediction or bi-prediction motion vectors arestored for a 4×4 subblock, two kinds of methods are proposed.

In a first method, for a 4×4 subblock, the sample weight value of its 4corners are summed up. If the sum is smaller than a threshold2 andgreater than a threshold1, bi-prediction motion vectors is stored forthis 4×4 subblock. Otherwise, uni-prediction motion vector is stored.The threshold1 and threshold2 are set to 32>>(((log 2(CuW)+log2(CuH))>>1)−1) and 32−threshold1, respectively.

In a second method, the following equations are used to determine whichmotion vector is stored for this 4×4 subblock depending on its position.

rho _(subblk)=3×Dis[displacementX]+3×Dis[displacementY]

distFromLine_(subblk)=((x _(subblk)<<3)+1)×Dis[displacementX]+(y_(subblk)<<3)+1)×Dis[displacementY]−rho+rho _(subblk)

motionMask[x _(subblk)][y_(subblk)]=abs(distFromLine_(subblk))<256?2(distFromLine_(subblk)≤0?0:1)

where (x_(subblk),y_(subblk)) represents the position of each 4×4subblock. The variables Dis[ ], displacementX, displacementY and rho arethe same as the variables described above. When the value ofmotionMask[x_(subblk)][y_(subblk)] is equal to 2, bi-prediction motionvectors are stored for this 4×4 subblock. Otherwise, uni-predictionmotion vector is stored for this 4×4 subblock.

Three exemplary syntax structures for the geometric partition mode areshown in FIGS. 16-17B, respectively.

In some embodiments, a sub block transform can be used. In the sub blocktransform, a residual block is split into two residual sub blocks, asshown in FIG. 18. Only one of the two residual sub blocks is coded. Forthe other residual sub block, the residue is set equal to 0.

For an inter prediction block with residue, a CU level flag is signaledto indicate whether sub block transform is applied or not. When the subblock transform mode is used, parameters are signaled to indicate thatthe residual block is symmetric or asymmetric split into two sub blocksin either horizontal or vertical direction.

Triangle partition and geometric partition modes are two partitioningmethods to improve the coding efficiency of motion compensation.Triangle partition may be viewed as a subset of geometric partition.However, in the current implementation, the syntax structure, blendingprocess, and motion field storage of geometric partition mode isdifferent from those of triangle partition mode. For example, thefollowing processes are different in these two modes.

1. For a block coded in merge mode, two flags (including a trianglepartition mode flag and a geometric partition mode flag) are signaled.Moreover, a triangle partition mode can be applied to blocks of whichwidth or height is equal to 4. However, a geometric partition modecannot be applied to those blocks.

2. The equations used in the calculation of weight of luma samples codedin the triangle partition mode is different from the luma sample weightcalculation in geometric partition mode. Moreover, the weight of chromasamples coded in triangle partition mode is calculated separately,whereas the weight of chroma samples coded in geometric partition modeis subsampled from the corresponding luma samples.

3. The motion vectors of a block coded in either triangle partition orgeometric partition modes are both stored in 4×4 subblocks. Anddepending on the position of each 4×4 subblock, either uni-prediction orbi-prediction motion vectors are stored. However, the process ofselecting one of uni-prediction or bi-prediction motion vectors to bestored for a 4×4 subblock is different for the triangle partition modeand geometric partition mode.

4. The SBT mode is not allowed in the case of triangle partition modebut it can be applied to the geometric partition mode.

Because the triangle partition mode can be viewed as a subset ofgeometric partition mode, it can unify all the process used in trianglepartition and geometric partition modes.

To unify the syntax of triangle partition and geometric partition modes,it can use only one flag to indicate whether a block is split into twopartitions. When the size of a block is larger than or equal to 64 lumasamples, the flag is signaled. When the flag is true, a partition modeindex is further signaled to indicate which partition method is used tosplit the block.

In one embodiment, a flag (e.g., the CIIP flag in FIGS. 19-20) issignaled when a block is not coded using subblock merge, regular merge,and MMVD modes.

In another embodiment, a flag (e.g., the triangle/geometric flag in FIG.21) is signaled at the beginning of merge syntax structure.

When a block is split into two partitions, a partition mode index isfurther signaled to indicate which partition method is used.

In one embodiment, the two triangle partition modes (e.g., splitting ablock either from a top-left corner to a bottom-right corner or atop-right corner to a bottom-left corner) is put in the front ofpartition mode list, followed by the geometric partition modes. In otherwords, when the partition mode index is equal to 0 or 1, the block issplit using the triangle partition mode. Otherwise, the block is splitusing the geometric partition mode.

In another embodiment, the triangle partition modes is treated as one ofgeometric partition modes, as shown in Table 22A of FIG. 22A. Forexample, when the partition mode index is equal to 19, the block issplit from a top-left corner to a bottom-right corner. As anotherexample, the partition mode index 58 represents that the block is splitfrom a top-right corner to a bottom-left corner.

In yet another embodiment, the triangle partition modes is also treatedas one of geometric partition modes, as shown in Table 22B of FIG. 22B.When the partition mode index is equal to 10, the block is split from atop-left corner to a bottom-right corner. Moreover, the partition modeindex being 24 represents that the block is split from a top-rightcorner to a bottom-left corner.

It is noted that the number of partition modes for a block may depend ona block size and/or a block shape.

In one embodiment, only two partition modes are allowed for a block ifits width or height is equal to 4, or the ratio of max(width,height)/min(width, height) is larger than 4. Otherwise, 142 partitionmodes are allowed.

In another embodiment, when the size of a block is larger than athreshold, the number of partition modes is reduced. For example, whenthe size of a block is larger than 1024 luma samples, only 24 quantizedangles and 4 quantized distances are allowed.

In yet another embodiment, when the block shape is narrow-and-tall orwide-and-flat, the number of partition modes is reduced. For example,when the ratio of max(width, height)/min(width, height) is larger than2, only 24 quantized angle and 4 quantized distance are allowed.Further, only angles that partition the block along the larger dimensionmay be allowed, as shown in FIG. 23. As shown in FIG. 23, for awide-and-flat block, the 3 angles shown in dashed lines are not allowed,and only the angles shown in solid lines are allowed.

In yet another embodiment, when the size of a block is larger than athreshold and the block shape is narrow-and-tall or wide-and-flat, thenumber of partition modes can be reduced. For example, when the size ofa block is larger than 1024 luma samples and the ratio of max(width,height)/min(width, height) is larger than 2, only 24 quantized angle and4 quantized distance are allowed. This may further be combined with therestriction shown in FIG. 23.

The look-up table for angle indices and distance indices may be changed.

In one embodiment, the partition mode index is used distance index firstorder instead of angle index first order, as shown in Table 24 of FIG.24.

In another embodiment, the partition mode index order is related to theoccurrence of partitioning method. The higher occurrence partitioningmethod is put in the front of the look-up table. An example is shown inTable 25 of FIG. 25. The angle index 0, 4, 8, and 12 with distance 0have higher probability to be used in partitioning a block.

As mentioned before, the triangle partition mode can be applied to ablock whose size is larger than or equal to 64 luma samples. However,the geometric partition mode can be applied to a block whose width andheight are both larger than or equal to 8 and the ratio of max(width,height)/min(width, height) is smaller than or equal to 4. It can unifythe restrictions on block size and block shape of triangle partition andgeometric partition modes.

In one embodiment, both the triangle partition mode and the geometricpartition mode can be applied to a block whose width and height are bothlarger than or equal to 8 and the ratio of max(width, height)/min(width,height) is smaller than or equal to 4.

In another embodiment, both the triangle partition mode and thegeometric partition mode can be applied to a block whose size is largerthan or equal to 64 luma samples.

In yet another embodiment, both the triangle partition mode and thegeometric partition mode can be applied to a block whose size is largerthan or equal to 64 luma samples and the ratio of max(width,height)/min(width, height) is smaller than or equal to 4.

Embodiments of the disclosure also provide a method for unifying theweight calculation process of triangle partition and geometric partitionmodes.

In one embodiment, the weight calculation process for luma samples oftriangle partition is replaced with the process used in geometricpartition mode (described in the above blending processing) with thefollowing two modification:

1. The value in Dis[ ] is replaced with the value in Table 26 of FIG.26.

2. wIdx=log 2(CuW)−2 and hIdx=log 2(CuH)−2.

In addition, for a block coded in the triangle partition mode, if theblock is split from the top-left corner to the bottom-right corner, theangleIdx and distanceIdx are set to 4 and 0, respectively. Otherwise(e.g., the block is split from the top-right corner to the bottom-leftcorner), the angleIdx and distanceIdx are set to 12 and 0, respectively.

In another embodiment, for both the triangle partition mode and thegeometric partition mode, the weight for chroma sample is subsampledfrom the top-left luma sample's weights of each 2×2 luma subblock.

In yet another embodiment, for both the triangle partition mode and thegeometric partition mode, the weight for a chroma sample is calculatedusing the same process as that used for a luma sample coded in thegeometric partition mode.

In this disclosure, it can also unify the process of motion fieldstorage used in the triangle partition mode and the geometric partitionmode.

In one embodiment, the motion field storage for the triangle partitionmode is replaced with that for the geometric partition mode. That is,the weights of 4 luma samples located at 4 corners of a 4×4 subblock aresummed up. If the sum is smaller than a threshold2 and greater than athreshold1, bi-prediction motion vectors can be stored for this 4×4subblock. Otherwise, a uni-prediction motion vector is stored. Thethreshold1 and threshold2 are set to 32>>(((log 2(CuW)+log2(CuH))>>1)−1) and 32−threshold1, respectively.

In another embodiment, for a block coded using either the trianglepartition mode or the geometric partition mode, the weight of each lumasample is checked. If the weight of a luma sample is not equal to 0 or8, the luma sample is viewed as a weighted sample. If all the lumasamples in a 4×4 subblock are weighted, the bi-prediction motion isstored for the 4×4 subblock. Otherwise, the uni-prediction motion isstored.

To harmonize the interaction between SBT and geometric partition modewith the interaction between SBT and triangle partition mode, it candisable SBT for geometric partition mode in this disclosure. Thecombination of SBT and geometric partition mode may create twointersection boundaries within a block, which may cause subjectivequality problem.

In one embodiment, the cu_sbt_flag is not signaled when the geometricpartition is used, as shown in Table 27 of FIG. 27. The related syntaxis italicized and highlighted in grey in FIG. 27.

In another embodiment, part of the SBT partition mode is disableddepending on the GEO partition mode. When an SBT partitioning edge isintersected with the GEO partitioning edge, this SBT partition mode isnot allowed. Otherwise, the SBT partition mode is allowed. FIG. 28 showsan example of the SBT partition mode and the GEO partition mode.Further, the angle and distance indices may be used to determine whetherthere is an intersection between the GEO partitioning edge and the SBTpartitioning edge. In one example, when an angle index of a currentblock is 0 (i.e., vertical partitioning edge), the horizontal SBTpartitioning cannot be applied to the current block. Moreover, the SBTsyntax may be modified as Table 29 of FIG. 29, with changes emphasizedin italic and grey.

The geometric partition mode splits a block into two geometric shapepartitions, and each geometric partition performs motion compensationwith its own motion vector. The geometric partition mode improves theprediction accuracy of inter prediction. However, it may be complicatedin the following aspects.

In a first aspect, the total number of geometric partitioning submodesis huge. Therefore, it is impossible to store all the masks for blendingweights and motion field storage in real implementation. The totalnumber of bits needed to store the masks in the case of 140 submodes is:

-   -   For blending weights:        (8×8+8×16+8×32+8×64+16×8+16×16+16×32+16×64+32×8+32×16+32×32+32×64+64×8+64×16+64×32+64×64+64×128+128×64+128×128)×140×4=26,414,080        bits=3,301,760 bytes=3.3 Mbytes    -   For motion field storage:        (2×2+2×4+2×8+2×16+4×2+4×4+4×8+4×16+8×2+8×4+8×8+8×16+16×2+16×4+16×8+16×16+16×32+32×16+32×32)×140×2=825,440        bits=103,180 bytes=103 Kbytes

140 108 80 64 partitioning partitioning partitioning partitioningsubmodes submodes submodes submodes blending 3,301,760 bytes 2,547,072bytes 1,886,720 1,509,376 weights bytes bytes motion   103,180 bytes   79,596 bytes    58,960    47,168 storage bytes bytes Overall3,404,940 bytes 2,626,668 bytes 1,945,680 1,556,544 bytes bytes

In a second aspect, if instead of storing them, the masks are calculatedon the fly, then computational complexity is increased. The equationsfor calculating the mask for blending weights and motion field storageare complicated. More specifically, the number of multiplication (x),shift (<<), addition (+) and comparison operations are huge. Assumingthat a block of size W×H, the numbers of each operation per block are:

-   -   Multiplication: 5+2×W×H+2×(W×H/16);    -   Shift: 4+3×W×H+2×(W×H/16);    -   Addition: 8+6×W×H+5×(W×H/16);    -   Comparison: 4+2×W×H+2×(W×H/16).

Details are listed in the following table.

Equations × << + comparison Per block 5 4 8 4 displacementX = angleIdx 00 0 0 displacementY = (displancementX + NumAngles >> 2)%NumAngles 1 1 10 rho = distanceIdx × (stepSize << scaleStep) + Dis[displacementX] 1 3 20 << wIdx + Dis[displacementY] << hIdx stepSize = stepDis + 77 0 0 1 0scaleStep = (wIdx ≥ hIdx) ? hIdx − 3 : wIdx − 3 0 0 2 1 wIdx = log2(CuW)0 0 0 0 hIdx = log2(CuH) 0 0 0 0 whRatio = (wIdx ≥ hIdx) ? (wIdx − hIdx): (hIdx − wIdx) 0 0 1 1 ${angleN} = \left\{ \begin{matrix}{{angleIdx}\mspace{14mu}\%\ 8} & {{{wIdx} \geq {{hIdx}\ {{and}\ \left( {{angleIdx} ⪢ 3} \right)}\%\ 1}} = 1} \\{8 - \left( {{angleIdx}\mspace{14mu}\%\ 8} \right)} & {{{wIdx} \geq {{hIdx}\ {{and}\ \left( {{angleIdx} ⪢ 3} \right)}\%\ 1}} = 0} \\{8 - \left( {{angleIdx}\mspace{14mu}\%\ 8} \right)} & {{{wIdx} < {{hIdx}\ {{and}\ \left( {{angleIdx} ⪢ 3} \right)}\%\ 1}} = 1} \\{{angleIdx}\mspace{14mu}\%\ 8} & {{{wIdx} < {{hIdx}\ {{and}\ \left( {{angleIdx} ⪢ 3} \right)}\%\ 1}} = 0}\end{matrix} \right.$ 1 0 1 2 rho_(subblk) = 3 × Dis[displacementX] + 3× Dis[displacementY] 2 0 0 0 Per luma sample 2 3 6 2 distFromLine = ((x<< 1) + 1) × Dis[displacementX] + 2 2 4 0 ((y << 1) + 1) ×Dis[displacementY]− rho distScaled = Min((abs(distFromLine) + 4) >>3,26) 0 1 1 1 sampleWeight_(L)[x][y] = distFromLine ≤ 0 ? 0 0 1 1GeoFilter[distScaled]: 8 − GeoFilter[distScaled] Per 4×4 subblock 2 2 52 distFromLine_(subblk) = ((x_(subblk) << 3) + 1) × Dis[displacementX] +2 2 5 0 ((y_(subblk) << 3) + 1) × Dis[displacementY] − rho +rho_(subblk) motionMask[x_(subblk)][y_(subblk)] =abs(distFromLine_(subblk)) < 256 ? 2 : 0 0 0 2 (distFromLine_(subblk) ≤0 ? 0 : 1)

Moreover, memory is still needed to store four pre-calculated tables,which are Dis[ ], GeoFilter[ ], stepDis[ ], and a look-up table forangleIdx and distanceIdx. The sizes of each table are listed as follows.

Table Size Dis[ ] 32 × 8 = 256 bits GeoFilter[ ] 27 × 4 = 108 bitsstepDis[ ] 45 × 11 = 495 bits Look-up table for 140 modes: 140 × (5 + 3)= 1120 bits angleIdx and distanceIdx 108 modes: 108 × (5 + 2) = 756 bits80 modes: 80 × (5 + 2) = 560 bits 64 modes: 64 × (5 + 2) = 448 bits

In a third aspect, in current geometric partition mode design, thecombinations of 45°/135° and distanceIdx 0 are always disallowed sincethey assume that triangle partition mode in VVC supports thesepartitioning options. However, for the non-square blocks, the partitionangle in triangle partition mode is not 45° or 135°, as shown in thefollowing table. Thus, it is meaningless to exclude these twopartitioning angles for the non-square blocks.

width:height ratio 1:1 1:2 1:4 1:8 1:16 Triangle angle 1 135° 116.5°104° 97.1° 93.6° Triangle angle 2  45°  63.5°  76° 82.9° 86.4°width:height ratio 2:1 4:1 8:1 16:1 Triangle angle 1 153.4° 166° 172.9°176.4° Triangle angle 2  26.6°  14°   7.1°   3.6°

In a fourth aspect, since some combinations of angle and distance arenot supported in geometric partition mode, such as horizontal split withdistanceIdx 0 or vertical split with distanceIdx 0 (this is to avoid theredundancy with binary tree partitions), a look-up table is used toderive the angle and distance for each geometric partitioning submode.The look-up table may not be necessary if the restrictions ofcombination of angle and distance are removed.

In a fifth aspect, the blending process, motion field storage, and thesyntax structure used in triangle partition mode and geometric partitionmode are not unified, which means that two kinds of logic are requiredfor these two modes in both software and hardware implementation.Besides, the total number of bits needed to store the masks for trianglemode is:

-   -   For blending weights:        (4×16+4×32+4×64+8×8+8×16+8×32+8×64+16×4+16×8+16×16+16×32+16×64+32×4+32×8+32×16+32×32+32×64+64×4+64×8+64×16+64×32+64×64+64×128+128×64+128×128)×2×4=384,512        bits=48,064 bytes=48 Kbytes    -   For motion field storage:        (1×4+1×8+1×16+2×2+2×4+2×8+2×16+4×1+4×2+4×4+4×8+4×16+8×1+8×2+8×4+8×8+8×16+16×1+16×2+16×4+16×8+16×16+16×32+32×16+32×32)×2×2=12,016        bits=1,502 bytes=1.5 Kbytes

140 geometric partitioning submodes + triangle mode 3,454,506 bytes 108geometric partitioning submodes + triangle mode 2,676,234 bytes 80geometric partitioning submodes + triangle mode 1,995,246 bytes 64geometric partitioning submodes + triangle mode 1,606,110 bytes

To solve aforementioned problems, several solutions are proposed.

A first solution is directed to simplification of the geometricpartition mode.

To avoid calculating the masks for blending weights and motion fieldstorage on the fly, it is proposed to derive the masks for each blockfrom several pre-calculated masks whose size is 256×256 or 64×64. Theproposed methods can reduce the memory for storing the masks.

In a proposed cropped method, a first and a second set of masks arepre-defined. The first set of masks, g_sampleWeight_(L)[ ], may containseveral masks, each of the masks has a size of 256×256, and the masksare used to derive blending weights for each block. The second set ofmasks, g_motionMask[ ], may contain several masks, each of the masks hasa size of 64×64, and the masks are used to derive the mask for motionfield storage for each block. The number of masks in the first and thesecond sets depends on the number of geometric partitioning submodes.For blocks of different sizes, their masks are cropped from one of maskin the first and the second set.

In one embodiment, the pre-defined masks in the first and the second setmay be calculated using the equations described with reference to FIGS.14 and 15A-15F and with respect to the motion field storage. The numberof masks in the first and the second sets are both N, where N is set tothe number of angles supported in geometric partition mode. The n^(th)masks with index n in the first and the second set represent the mask ofangle n, where n is in the range from 0 to N−1.

In one example, the variable N is set to 16 when the number of geometricpartitioning submodes is set to 140, that is, 16 angles plus 9distances. In another example, the variable N is set to 16 when thenumber of geometric partitioning submodes is set to 108, that is, 16angles plus 7 distances. In other example, the variable N is set to 12and 10 when the number of geometric partitioning submodes is set to 80(12 angles plus 7 distances) and 64 (10 angles plus 7 distances),respectively.

For a block whose size is W×H with geometric partitioning index set toK, the mask for blending weights of luma samples are derived as follows.

-   -   Variables angleIdx A and distanceIdx D are obtained from a        look-up table using the geometric partitioning index K. Examples        of the look-up table are shown in Table 15C of FIG. 15C, Table        15D of FIG. 15D, Table 22B of FIG. 22B, Table 30 of FIG. 30, and        Table 31 of FIG. 31.    -   Variables offsetX and offsetY are calculated as follows.

${offsetX} = \left\{ {{\begin{matrix}{\left( {256 - W} \right) ⪢ 1} & \begin{matrix}{{horizontal}\mspace{14mu}{split}\mspace{14mu}{or}\mspace{14mu}\left( {{not}\mspace{14mu}{vertical}}\mspace{14mu} \right.} \\\left. {{{split}\mspace{14mu}{and}\mspace{14mu} H} \geq W} \right)\end{matrix} \\\begin{matrix}{{\left( {\left( {256 - W} \right) ⪢ 1} \right) + A} < {N?}} \\{\left( {D \times W} \right) ⪢ {{3\text{:}} - \left( {\left( {D \times W} \right) ⪢ 3} \right)}}\end{matrix} & {otherwise}\end{matrix}{offsetY}} = \left\{ {{\begin{matrix}\begin{matrix}{{\left( {\left( {256 - H} \right) ⪢ 1} \right) + A} < {N?}} \\{\left( {D \times H} \right) ⪢ {{3\text{:}} - \left( {\left( {D \times H} \right) ⪢ 3} \right)}}\end{matrix} & \begin{matrix}{{horizontal}\mspace{14mu}{split}\mspace{14mu}{or}\mspace{14mu}\left( {{not}\mspace{14mu}{vertical}} \right.} \\\left. {{{split}\mspace{14mu}{and}\mspace{14mu} H} \geq W} \right)\end{matrix} \\{\left( {256 - H} \right) ⪢ 1} & {otherwise}\end{matrix} - {{{sampleWeight}_{L}\lbrack x\rbrack}\lbrack y\rbrack}} = {{{{g\_ sampleWeight}_{L}\left\lbrack {A\mspace{11mu}\%\mspace{11mu} N} \right\rbrack}\left\lbrack {x + {offsetX}} \right\rbrack}\left\lbrack {y + {offsetY}} \right\rbrack}} \right.} \right.$

The blending weights for chroma samples are subsampled from the weightsof luma samples. That is, the weight of top-left luma sample for eachcorresponding 2×2 luma subblock is used as the weight of chroma samplefor YUV 4:2:0 video format.

Moreover, the mask for motion field storage is derived as follows.

-   -   Variables offsetXmotion and offsetYmotion are calculated as        follows:

${offsetXmotion} = \left\{ {{\begin{matrix}{\left( {64 - \left( {W ⪢ 2} \right)} \right) ⪢ 1} & {{{horizontal}\mspace{14mu}{split}\mspace{14mu}{or}}\;} \\\; & \left( {{{not}\mspace{14mu}{vertical}\mspace{14mu}{split}\mspace{14mu}{and}\mspace{14mu} H} \geq W} \right) \\{{\left( {\left( {64 - \left( {W ⪢ 2} \right)} \right) ⪢ 1} \right) + A} < {N?}} & {otherwise} \\{\left( {D \times W} \right) ⪢ {{5\text{:}} - \left( {\left( {D \times W} \right) ⪢ 5} \right)}} & \;\end{matrix}{offsetYmotion}} = \left\{ {{\begin{matrix}\begin{matrix}{{\left( {\left( {64 - \left( {H ⪢ 2} \right)} \right) ⪢ 1} \right) + A} <} \\{{{N?}\left( {D \times H} \right)} ⪢ {{5\text{:}} - \left( {\left( {D \times H} \right) ⪢ 5} \right)}}\end{matrix} & \begin{matrix}{{{horizontal}\mspace{14mu}{split}\mspace{14mu}{or}}\;} \\\left( {{{not}\mspace{14mu}{vertical}\mspace{14mu}{split}\mspace{14mu}{and}\mspace{14mu} H} \geq W} \right)\end{matrix} \\{\left( {64 - \left( {H ⪢ 2} \right)} \right) ⪢ 1} & {otherwise}\end{matrix}{{{motionMask}\left\lbrack x_{subbik} \right\rbrack}\left\lbrack y_{subbik} \right\rbrack}} = {{{g\_ motionMask}\left\lbrack {A\mspace{11mu}\%\mspace{11mu} N} \right\rbrack}{\quad{\left\lbrack {x_{subbik} + {offsetXmotion}} \right\rbrack\left\lbrack {y_{subbik} + {offsetYmotion}} \right\rbrack}}}} \right.} \right.$

The number of bits needed to store the pre-defined masks are listed asfollows:

-   -   For blending weights: (256×256)×16×4=4,193,304 bits=524,288        bytes 524 Kbytes    -   For motion field storage: (64×64)×16×2=131,072 bits=16,384 bytes        16 Kbytes

140 108 80 64 partitioning partitioning partitioning partitioningsubmodes submodes submodes submodes blending 524,288 bytes 524,288 bytes393,216 bytes 327,680 bytes weights motion  16,384 bytes  16,384 bytes 12,288 bytes  10,240 bytes storage Overall 540,672 bytes 540,672 bytes405,504 bytes 337,920 bytes % of 84.1% 79.4% 79.2% 78.3% reductioncompared to original geometric design

Moreover, the mask can be calculated on the fly using the followingsimplified equations:

distFromLine=(((x+offsetX)<<1)+1)×Dis[displacementX]+(((y+offsetY)<<1)+1)×Dis[displacementY]−Rho[displacementX]

distScaled=Min((abs(distFromLine)+4)>>3,26)

sampleWeight_(L)[x][y]=distFromLine≤0?GeoFilter[distScaled]:8−GeoFilter[distScaled]

where (x,y) represents the position of each luma sample, Dis[ ] andGeoFilter[ ] are two look-up tables as shown in Table 12 and Table 13,respectively. Rho[ ] is a look-up table shown in Table 32 of FIG. 32.

The parameters displacementX and displacementY are calculated asfollows:

displacementX=angleIdx%16

displacementY=(displancementX+NumAngles>>2)% NumAngles

where NumAngles is set to 32. The angleIdx is derived from Table 15C,Table 15D, Table 15E, and Table 15F, when the total number of geometricpartitioning submodes is set to 140, 108, 80 and 64, respectively. TheangleIdx can also be derived from the look-up table are shown in Table22B, Table 30, and Table 31.

distFromLine_(subblk)=(((x_(subblk)+offsetXmotion)<<3)+1)×Dis[displacementX]+(((y_(subblk)+offsetYmotion)<<3)+1)×Dis[displacementY]−Rho_(subblk)[displacementX]

motioMask[x _(subblk)][y_(subblk)]=abs(distFromLine_(subblk))<256?2:(distFromLine_(subblk)≤0?0:1)

Assuming that a block of size W×H, the numbers of each operation perblock are:

-   -   Multiplication: 4+2×W×H+2×(W×H/16);    -   Shift: 9+3×W×H+2×(W×H/16);    -   Addition: 7+8×W×H+6×(W×H/16);    -   Comparison: 6+2×W×H+2×(W×H/16).

Details on numbers of each operation per block are listed in Table 33 ofFIG. 33.

The memory are needed to store five pre-calculated tables, which areDis[ ], GeoFilter[ ], Rho[ ], Rho_(subblk)[ ] and the look-up tables forangleIdx and distanceIdx. The look-up table for Rho_(subblk)[ ] isillustrated in FIG. 34. The sizes of each table are listed as follows.

Table Size Dis[ ] 32 × 8 = 256 bits GeoFilter[ ] 27 × 4 = 108 bits Rho[] 16 × 16 = 256 bits Rho_(subblk)[ ] 16 × 16 = 256 bits Look-up tablefor 140 modes: 140 × (5 + 3) = 1120 bits angleIdx and distanceIdx 108modes: 108 × (5 + 2) = 756 bits 80 modes: 80 × (5 + 2) = 560 bits 64modes: 64 × (5 + 2) = 448 bits

The computational complexity of the proposed method is similar to thatof the original geometric design. More specifically, comparing to theoriginal geometric design.

-   -   The number of multiplication operation is increased by 1 for a        W×H block    -   The number of shift operation is increased by 5 for a W×H block    -   The number of comparison operation is increased by 2 for a W×H        block    -   The number of addition operation is increased by        2×W×H+(W×H/16)−1 for a W×H block    -   The memory usage is increased by 17 bits

The equations used to calculate the mask can be further simplified asfollows:

-   -   Variables angleIdx A and distanceIdx D are obtained from a        look-up table using the geometric partitioning index K. Examples        of the look-up table are shown in Table 15C, Table 15D, Table        22B, Table 30, and Table 31.    -   Variable N (the number of masks in the first and the second        sets) is set to 16 when the angleIdx and distanceIdx are derived        using the Table 15C, Table 15D and Table 22B. On the other        hands, variable N is set to 12 and 10 when the angleIdx and        distanceIdx are derived using the Table 30 and Table 31,        respectively    -   Variables offsetX and offsetY are calculated as follows:

${offsetX} = \left\{ {{\begin{matrix}{\left( {- W} \right) ⪢ 1} & {{horizontal}\mspace{14mu}{split}\mspace{14mu}{or}\mspace{14mu}\left( {{not}\mspace{14mu}{vertical}\mspace{14mu}{split}}\; \right.} \\\; & \left. {{{and}\mspace{14mu} H} \geq W} \right) \\{{\left( {\left( {- W} \right) ⪢ 1} \right) + A} < {N?}} & {otherwise} \\{{\left( {D \times W} \right) ⪢ 3}:{- \left( {\left( {D \times W} \right) ⪢ 3} \right)}} & \;\end{matrix}{offsetY}} = \left\{ \begin{matrix}\begin{matrix}{{\left( {\left( {- H} \right) ⪢ 1} \right) + A} < {{N?}\left( {D \times H} \right)} ⪢ {{3\text{:}} -}} \\\left( {\left( {D \times H} \right) ⪢ 3} \right)\end{matrix} & \begin{matrix}{{horizontal}\mspace{14mu}{split}\mspace{14mu}{or}\mspace{14mu}\left( {{not}\mspace{14mu}{vertical}} \right.} \\\left. {{{split}\mspace{14mu}{and}\mspace{14mu} H} \geq W} \right)\end{matrix} \\{\left( {- H} \right) ⪢ 1} & {otherwise}\end{matrix} \right.} \right.$

-   -   Variables displacementX and displacementY are calculated as        follows:

displacementX=angleIdx

displacementY=(displancementX+NumAngles>>2)% NumAngles,

where NumAngles is set to 32.

-   -   The weight for a luma sample located at position (x,y) is        calculated as follow:

weightIdx=(((x+offsetX)<<1)+I)*disLut[displacementX]+(((y+offsetY)<<1)+1))*disLut[displacementY]

partFlip=(angleIdx>=13&& angleIdx<=27)?0:1

weightIdxL=partFlip?32+weightIdx:32−weightIdx

sampleWeight_(L)[x][y]=Clip3(0,8,(weightIdxL+4)>>3),

where disLut[ ] is a look-up table shown in the following:

angleIdx 0 2 3 4 5 6 8 10 11 12 13 14 disLut[idx] 8 8 8 4 4 2 0 −2 −4 −4−8 −8 angleIdx 16 18 19 20 21 22 24 26 27 28 29 30 disLut[idx] −8 −8 −8−4 −4 −2  0  2  4  4  8  8

In another embodiment, the pre-defined masks in the first and the secondset may be calculated using the equations described in with reference toFIGS. 14 and 15A-15F and with respect to the motion field storage. Thenumber of masks in the first and the second set are both N_(reduced),where N_(reduced)=(N>>1)+1 and N is the number of angles supported ingeometric partition mode. In one example, the variable N_(reduced) isset to 9 when the number of geometric partitioning submodes is set to140. That is, 16 angles plus 9 distances. In another example, thevariable N_(reduced) is set to 9, 7, and 6, when the number of geometricpartitioning submodes is set to 108 (16 angles plus 7 distances), 80 (12angles plus 7 distances), and 64 (10 angles plus 7 distances),respectively.

For the angle between 0 and N_(reduced)−1, their masks are directlycropped from the masks in the first and the second set. On the otherhands, the masks for the angle between N_(reduced) and N−1 are croppedfrom the masks in the first and the second set and flipped in horizontaldirection. FIG. 35A shows examples for the masks of angle 135°, and FIG.35B shows examples for the masks of angle 45°, consistent with thepresent embodiment.

For a block whose size is W×H with geometric partitioning index set toK, the mask for blending weights of luma samples are derived as follows.

-   -   Variables angleIdx A and distanceIdx D are obtained from a        look-up table using the geometric partitioning index K. Examples        of the look-up table are shown in Table 15C, Table 15D, Table        22B, Table 30, and Table 31.    -   Variables offsetX and offsetY can be calculated as follows.

${offsetX} = \left\{ {{\begin{matrix}{\left( {256 - W} \right) ⪢ 1} & \begin{matrix}{{{horizontal}\mspace{14mu}{split}\mspace{14mu}{or}}\mspace{25mu}} \\\left( {{{not}\mspace{14mu}{vertical}\mspace{14mu}{split}\mspace{14mu}{and}\mspace{14mu} H} \geq W} \right)\end{matrix} \\\begin{matrix}\left( {{\left( {{256 - W} ⪢ 1} \right) + A} < {N?}} \right. \\{\left( {D \times W} \right) ⪢ {{3\text{:}} - \left( {\left( {D \times W} \right) ⪢ 3} \right)}}\end{matrix} & {otherwise}\end{matrix}{offsetY}} = \left\{ {{\begin{matrix}\begin{matrix}{{\left( {\left( {256 - H} \right) ⪢ 1} \right) + A} < {{N?}\left( {D \times H} \right)} ⪢} \\{{3\text{:}} - \left( {\left( {D \times H} \right) ⪢ 3} \right)}\end{matrix} & \begin{matrix}{{{horizontal}\mspace{14mu}{split}\mspace{14mu}{or}}\;} \\\left( {{{not}\mspace{14mu}{vertical}\mspace{14mu}{split}\mspace{14mu}{and}\mspace{14mu} H} \geq W} \right)\end{matrix} \\{\left( {256 - H} \right) ⪢ 1} & {otherwise}\end{matrix}{{{sampleWeight}_{L}\lbrack x\rbrack}\lbrack y\rbrack}} = \left\{ \begin{matrix}{{{g\_ sampleWeight}_{L}\left\lbrack {A\mspace{11mu}\%\mspace{11mu} N} \right\rbrack}\left\lbrack \left( {x + {offsetX}} \right\rbrack \right.} & {{A\mspace{11mu}\%\mspace{11mu} N} < N_{reduced}} \\\left\lbrack {y + {offsetY}} \right\rbrack & \; \\{{{g\_ sampleWeight}_{L}\left\lbrack {N - {A\mspace{11mu}\%\mspace{11mu} N}} \right\rbrack}\left\lbrack {x + {offsetX}} \right\rbrack} & {otherwise} \\\left\lbrack {H - 1 - y + {offsetY}} \right\rbrack & \;\end{matrix} \right.} \right.} \right.$

The blending weights for chroma samples are subsampled from the weightsof luma samples. That is, the weight of top-left luma sample for eachcorresponding 2×2 luma subblock is used as the weight of chroma samplefor YUV 4:2:0 video format.

On the other hands, the mask for motion field storage is derived asfollows:

Variables offsetXmotion and offsetYmotion are calculated as follows:

${offsetXmotion} = \left\{ {{\begin{matrix}{\left( {64 - \left( {W ⪢ 2} \right)} \right) ⪢ 1} & \begin{matrix}{{{horizontal}\mspace{14mu}{split}\mspace{14mu}{or}}\;} \\\left( {{{not}\mspace{14mu}{vertical}\mspace{14mu}{split}\mspace{14mu}{and}\mspace{14mu} H} \geq W} \right)\end{matrix} \\\begin{matrix}{{\left( {\left( {64 - \left( {W ⪢ 2} \right)} \right) ⪢ 1} \right) + A} <} \\{{{N?}\left( {D \times W} \right)} ⪢ {{5\text{:}} - \left( {\left( {D \times W} \right) ⪢ 5} \right)}}\end{matrix} & {otherwise}\end{matrix}{offsetYmotion}} = \left\{ {{\begin{matrix}\begin{matrix}{{\left( {\left( {64 - \left( {H ⪢ 2} \right)} \right) ⪢ 1} \right) + A} <} \\{{{N?}\left( {D \times H} \right)} ⪢ {{5\text{:}} - \left( {\left( {D \times H} \right) ⪢ 5} \right)}}\end{matrix} & \begin{matrix}{{{horizontal}\mspace{14mu}{split}\mspace{14mu}{or}}\mspace{11mu}} \\\left( {{{not}\mspace{14mu}{vertical}\mspace{14mu}{split}\mspace{14mu}{and}\mspace{14mu} H} \geq W} \right)\end{matrix} \\{\left( {64 - \left( {H ⪢ 2} \right)} \right) ⪢ 1} & {otherwise}\end{matrix}{{{motionMask}\left\lbrack x_{subblk} \right\rbrack}\left\lbrack Y_{subblk} \right\rbrack}} = \left\{ \begin{matrix}{{{g\_ motionMask}\left\lbrack {A\mspace{11mu}\%\mspace{11mu} N} \right\rbrack}\left\lbrack {x_{subblk} + {offsetXmotion}} \right\rbrack} & {{A\mspace{11mu}\%\mspace{11mu} N} < N_{reduced}} \\\left\lbrack {y_{subblk} + {offsetYmotion}} \right\rbrack & \; \\{{{g\_ motionMask}\left\lbrack {N - {A\mspace{11mu}\%\mspace{11mu} N}} \right\rbrack}\left\lbrack {\left( {W ⪢ 2} \right) - 1 - x_{subblk} +} \right.} & {otherwise} \\{\left. {offsetXmotion} \right\rbrack\left\lbrack {y_{subblk} + {offsetYmotion}} \right\rbrack} & \;\end{matrix} \right.} \right.} \right.$

The number of bits needed to store the pre-defined masks are listed asfollows:

-   -   For blending weights: (256×256)×9×4=2,359,296 bits=294,912 bytes        295 Kbytes    -   For motion field storage: (64×64)×9×2=131,072 bits=16,384 bytes        16 Kbytes

140 108 80 64 partitioning partitioning partitioning partitioningsubmodes submodes submodes submodes blending 294,912 294,912 229,376196,608 weights bytes bytes bytes bytes motion  9,216  9,216  7,168 6,144 storage bytes bytes bytes bytes Overall 304,128 304,128 236,544202,752 bytes bytes bytes bytes % of 91.1% 88.4% 87.8% 87.0% reductioncompared to original geometric design

In a third embodiment, the pre-defined masks in the first and the secondset may be calculated using the equations described above. The number ofmasks in the first and the second set are both N_(reduced), whereN_(reduced)=(N>>1)+1 and N is the number of angles supported ingeometric partition mode. For the angle between 0 and N_(reduced)−1,their masks are directly cropped from the masks in the first and thesecond set. On the other hands, the masks for the angle betweenN_(reduced) and N−1 are cropped from the masks in the first and thesecond set and flipped in vertical direction. FIG. 36 shows examples forthe masks of angle 135°, and FIG. 36B shows examples for the masks ofangle 45°, consistent with the present embodiment.

For a block whose size is W×H with geometric partitioning index set toK, the mask for blending weights of luma samples are derived as follows:

Variables angleIdx A and distanceIdx D are obtained from a look-up tableusing the geometric partitioning index K. Examples of the look-up tableare shown in Table 15C, Table 15D, Table 22B, Table 30, and Table 31.

Variables offsetX and offsetY can be calculated as follows:

${offsetX} = \left\{ {{\begin{matrix}{\left( {256 - W} \right) ⪢ 1} & \begin{matrix}{{{horizontal}\mspace{14mu}{split}\mspace{14mu}{or}}\;} \\\left( {{{not}\mspace{14mu}{vertical}\mspace{14mu}{split}\mspace{14mu}{and}\mspace{14mu} H} \geq W} \right)\end{matrix} \\\begin{matrix}{{\left( {\left( {256 - W} \right) ⪢ 1} \right) + A} < {{N?}\left( {D \times W} \right)}} \\{⪢ {{3\text{:}} - \left( {\left( {D \times W} \right) ⪢ 3} \right)}}\end{matrix} & {otherwise}\end{matrix}{offsetY}} = \left\{ {{\begin{matrix}\begin{matrix}{{\left( {\left( {256 - H} \right) ⪢ 1} \right) + A} < {{N?}\left( {D \times H} \right)} ⪢} \\{{3\text{:}} - \left( {\left( {D \times H} \right) ⪢ 3} \right)}\end{matrix} & \begin{matrix}{{{horizontal}\mspace{14mu}{split}\mspace{14mu}{or}}\mspace{11mu}} \\\left( {{{not}\mspace{14mu}{vertical}\mspace{14mu}{split}\mspace{14mu}{and}\mspace{14mu} H} \geq W} \right)\end{matrix} \\{\left( {256 - H} \right) ⪢ 1} & {otherwise}\end{matrix}{{{sampleWeight}_{L}\lbrack x\rbrack}\lbrack y\rbrack}} = \left\{ \begin{matrix}{{{g\_ sampleWeight}_{L}\left\lbrack {A\mspace{11mu}\%\mspace{11mu} N} \right\rbrack}\left\lbrack \left( {x + {offsetX}} \right\rbrack \right.} & {{A\mspace{11mu}\%\mspace{11mu} N} < N_{reduced}} \\\left\lbrack {y + {offsetY}} \right\rbrack & \; \\{{{g\_ sampleWeight}_{L}\left\lbrack {N - {A\mspace{11mu}\%\mspace{11mu} N}} \right\rbrack}\left\lbrack {x + {offsetX}} \right\rbrack} & {otherwise} \\\left\lbrack {H - 1 - y + {offsetY}} \right\rbrack & \;\end{matrix} \right.} \right.} \right.$

The blending weights for chroma samples are subsampled from the weightsof luma samples. That is, the weight of top-left luma sample for eachcorresponding 2×2 luma subblock is used as the weight of chroma samplefor YUV 4:2:0 video format.

On the other hands, the mask for motion field storage is derived asfollows:

Variables offsetXmotion and offsetYmotion can be calculated as follows:

${offsetXmotion} = \left\{ {{\begin{matrix}{\left( {64 - \left( {W ⪢ 2} \right)} \right) ⪢ 1} & \begin{matrix}{{{horizontal}\mspace{14mu}{split}\mspace{14mu}{or}}\mspace{11mu}} \\\left( {{{not}\mspace{14mu}{vertical}\mspace{14mu}{split}\mspace{14mu}{and}\mspace{14mu} H} \geq W} \right)\end{matrix} \\\begin{matrix}{{\left( {\left( {64 - \left( {W ⪢ 2} \right)} \right) ⪢ 1} \right) + A} <} \\{{N?\left( {D \times W} \right)} ⪢ {{5\text{:}} - \left( {\left( {D \times W} \right) ⪢ 5} \right)}}\end{matrix} & {otherwise}\end{matrix}{offsetYmotion}} = \left\{ {{\begin{matrix}\begin{matrix}{{\left( {\left( {64 - \left( {H ⪢ 2} \right)} \right) ⪢ 1} \right) + A} <} \\{{{N?}\left( {D \times H} \right)} ⪢ {{5\text{:}} - \left( {\left( {D \times H} \right) ⪢ 5} \right)}}\end{matrix} & \begin{matrix}{{{horizontal}\mspace{14mu}{split}\mspace{14mu}{or}}\mspace{11mu}} \\\left( {{{not}\mspace{14mu}{vertical}\mspace{14mu}{split}\mspace{14mu}{and}\mspace{14mu} H} \geq W} \right)\end{matrix} \\{\left( {64 - \left( {H ⪢ 2} \right)} \right) ⪢ 1} & {otherwise}\end{matrix}{{{motionMask}\left\lbrack x_{subblk} \right\rbrack}\left\lbrack Y_{subblk} \right\rbrack}} = \left\{ \begin{matrix}{{{g\_ motionMask}\left\lbrack {A\mspace{11mu}\%\mspace{11mu} N} \right\rbrack}\left\lbrack {x_{subblk} + {offsetXmotion}} \right\rbrack} & {{A\mspace{11mu}\%\mspace{11mu} N} < N_{reduced}} \\\left\lbrack {y_{subblk} + {offsetYmotion}} \right\rbrack & \; \\{{{g\_ motionMask}\left\lbrack {N - {A\mspace{11mu}\%\mspace{11mu} N}} \right\rbrack}\left\lbrack {x_{subblk} + {offsetXmotion}} \right\rbrack} & {otherwise} \\\left. {\left\lbrack {H ⪢ 2} \right) - 1 - y_{subblk} + {offsetYmotion}} \right\rbrack & \;\end{matrix} \right.} \right.} \right.$

The number of bits needed to store the pre-defined masks are listed asfollows:

-   -   For blending weights: (256×256)×9×4=2,359,296 bits=294,912        bytes≅295 Kbytes    -   For motion field storage: (64×64)×9×2=131,072 bits=16,384        bytes≅16 Kbytes

140 108 80 64 partitioning partitioning partitioning partitioningsubmodes submodes submodes submodes blending 294,912 bytes 294,912 bytes229,376 bytes 196,608 bytes weights motion   9,216 bytes   9,216 bytes  7,168 bytes   6,144 bytes storage Overall 304,128 bytes 304,128 bytes236,544 bytes 202,752 bytes % of 91.1% 88.4% 87.8% 87.0% reductioncompared to original geometric design

It is noted that in the aforementioned embodiments, the methods foroffset derivation and chroma weights derivation may be modified.

Different methods for the offset derivation are presented as below. Ascompared to the embodiments above, the differences are highlighted initalic and bold.

The equations for offset derivation may be modified to guarantee thatthe offset is not equal to 0 when distanceIdx is not 0. In one example,the variables offsetX and offsetY are calculated as follow.

${offsetX} = \left\{ {{\begin{matrix}{\left( {256 - W} \right) ⪢ 1} & \begin{matrix}{{{horizontal}\mspace{14mu}{split}\mspace{14mu}{or}}\mspace{11mu}} \\\left( {{{not}\mspace{14mu}{vertical}\mspace{14mu}{and}\mspace{14mu} H} \geq W} \right)\end{matrix} \\{{\left( {\left( {256 - W} \right) ⪢ 1} \right) + A} < {{N?D} \times \max}} & {otherwise} \\{{\left( {1,{W ⪢ 3}} \right)\text{:}} - \left( {D \times {\max\left( {1,{W ⪢ 3}} \right)}} \right)} & \;\end{matrix}{offsetY}} = \left\{ \begin{matrix}\begin{matrix}{{\left( {\left( {256 - H} \right) ⪢ 1} \right) + A} < {{N?D} \times \max}} \\{{\left( {1,{H ⪢ 3}} \right)\text{:}} - \left( {D \times {\max\left( {1,{H ⪢ 3}} \right)}} \right)}\end{matrix} & \begin{matrix}{{{horizontal}\mspace{14mu}{split}\mspace{14mu}{or}}\mspace{11mu}} \\\left( {{{not}\mspace{14mu}{vertical}\mspace{14mu}{and}\mspace{14mu} H} \geq W} \right)\end{matrix} \\{\left( {256 - H} \right) ⪢ 1} & {otherwise}\end{matrix} \right.} \right.$

The offset derivation may be based on the number of distances supportedin geometric partition mode. In one example, when 7 distances aresupported, the variables offsetX and offsetY are calculated as follow(which is the same as the method presented in the first embodiment).

${offsetX} = \left\{ {{\begin{matrix}{\left( {256 - W} \right) ⪢ 1} & {{{horizontal}\mspace{14mu}{split}\mspace{14mu}{or}}\mspace{14mu}} \\\; & \left( {{{not}\mspace{14mu}{vertical}\mspace{14mu}{split}\mspace{14mu}{and}\mspace{14mu} H} \geq W} \right) \\{{\left( {\left( {256 - W} \right) ⪢ 1} \right) + A} < {{N?}\left( {D \times W} \right)}} & {otherwise} \\{{⪢ 3}:{- \left( {\left( {D \times W} \right) ⪢ 3} \right)}} & \;\end{matrix}{offsetY}} = \left\{ \begin{matrix}\begin{matrix}{{\left( {\left( {256 - H} \right) ⪢ 1} \right) + A} < {{N?}\left( {D \times H} \right)} ⪢} \\{{3\text{:}} - \left( {\left( {D \times H} \right) ⪢ 3} \right)}\end{matrix} & \begin{matrix}{{{horizontal}\mspace{14mu}{split}\mspace{14mu}{or}}\mspace{11mu}} \\\left( {{{not}\mspace{14mu}{vertical}\mspace{14mu}{split}\mspace{14mu}{and}\mspace{14mu} H} \geq W} \right)\end{matrix} \\{\left( {256 - H} \right) ⪢ 1} & {otherwise}\end{matrix} \right.} \right.$

In another example, when 9 distances are supported, the variablesoffsetX and offsetY are calculated as follow:

${offsetX} = \left\{ {{\begin{matrix}{\left( {256 - W} \right) ⪢ 1} & {{{horizontal}\mspace{14mu}{split}\mspace{14mu}{or}}\mspace{14mu}} \\\; & \left( {{{not}\mspace{14mu}{vertical}\mspace{14mu}{split}\mspace{14mu}{and}\mspace{14mu} H} \geq W} \right) \\{{\left( {\left( {256 - W} \right) ⪢ 1} \right) + A} < {{N?}\left( {D \times W} \right)}} & {otherwise} \\{{⪢ 4}:{- \left( {\left( {D \times W} \right) ⪢ 4} \right)}} & \;\end{matrix}{offsetY}} = \left\{ \begin{matrix}\begin{matrix}{{\left( {\left( {256 - H} \right) ⪢ 1} \right) + A} < {{N?}\left( {D \times H} \right)}} \\{⪢ {{4\text{:}} - \left( {\left( {D \times H} \right) ⪢ 4} \right)}}\end{matrix} & \begin{matrix}{{{horizontal}\mspace{14mu}{split}\mspace{14mu}{or}}\;} \\\left( {{{not}\mspace{14mu}{vertical}\mspace{14mu}{split}\mspace{14mu}{and}\mspace{14mu} H} \geq W} \right)\end{matrix} \\{\left( {256 - H} \right) ⪢ 1} & {otherwise}\end{matrix} \right.} \right.$

The offset derivation may be based on the partitioning angle. In oneexample, for the angle from 135° to 225° and from 315° to 45°, theoffsets are added in vertical direction. Otherwise, the offsets areadded in horizontal direction for the angle from 45° to 135° and from225° to 315°. The variables offsetX and offsetY are calculated asfollow.

${offsetX} = \left\{ {{\begin{matrix}{\left( {256 - W} \right) ⪢ 1} & {{{angle}\mspace{14mu}{from}\mspace{14mu} 135{^\circ}\mspace{14mu}{to}\mspace{14mu} 225{^\circ}\mspace{14mu}{and}}\mspace{11mu}} \\\; & {{from}\mspace{14mu} 315{^\circ}\mspace{14mu}{to}\mspace{14mu} 45{^\circ}} \\{{\left( {\left( {256 - W} \right) ⪢ 1} \right) + A} < {{N?}\left( {D \times W} \right)}} & {otherwise} \\{{⪢ 3}:{- \left( {\left( {D \times W} \right) ⪢ 3} \right)}} & \;\end{matrix}{offsetY}} = \left\{ \begin{matrix}{{\left( {\left( {256 - H} \right) ⪢ 1} \right) + A} < {{N?}\left( {D \times W} \right)}} & {{angle}\mspace{14mu}{from}\mspace{14mu} 135{^\circ}\mspace{14mu}{to}\mspace{14mu} 225{^\circ}\mspace{14mu}{and}} \\{{⪢ 3}:{- \left( {\left( {D \times W} \right) ⪢ 3} \right)}} & {{from}\mspace{14mu} 315{^\circ}\mspace{14mu}{to}\mspace{14mu} 45{^\circ}} \\{\left( {256 - W} \right) ⪢ 1} & {otherwise}\end{matrix} \right.} \right.$

The weights for chroma samples may be directly derived from the firstset of masks, g_sampleWeight_(L)[ ]. For a block whose size is W×H withgeometric partitioning index set to K, the mask for blending weights ofchroma samples are derived as follows.

-   -   The size of chroma block is W′×H′    -   Variables angleIdx A and distanceIdx D are obtained from a        look-up table using the geometric partitioning index K. Examples        of the look-up table are shown in Table 15C, Table 15D, Table        22B, Table 30, and Table 31.    -   Variables offsetXchroma and offsetYchroma are calculated as        follows.

${offsetXchroma} = \left\{ {{\begin{matrix}{\left( {256 - W^{\prime}} \right) ⪢ 1} & {{{horizontal}\mspace{14mu}{split}\mspace{14mu}{or}}\mspace{11mu}} \\\; & \left( {{{not}\mspace{14mu}{vertical}\mspace{14mu}{and}\mspace{14mu} H^{\prime}} \geq W^{\prime}} \right) \\{{\left( {\left( {256 - W^{\prime}} \right) ⪢ 1} \right) + A} < {N?}} & {otherwise} \\{\left( {D \times W^{\prime}} \right) ⪢ {{3\text{:}} - \left( {\left( {D \times W^{\prime}} \right) ⪢ 3} \right)}} & \;\end{matrix}{offsetYchroma}} = {\left\{ {{\begin{matrix}{{\left( {\left( {256 - H^{\prime}} \right) ⪢ 1} \right) + A} < {N?}} & {{{horizontal}\mspace{14mu}{split}\mspace{14mu}{or}}\mspace{11mu}} \\{\left( {D \times {minSize}} \right) ⪢ {{3\text{:}} - \left( {\left( {D \times {minSize}} \right) ⪢ 3} \right.}} & \left( {{{not}\mspace{14mu}{vertical}\mspace{14mu}{and}\mspace{14mu} H} \geq W} \right) \\{\left( {256 - {minSize}} \right) ⪢ 1} & {otherwise}\end{matrix}{{{sampleWeight}_{L}\lbrack x\rbrack}\lbrack y\rbrack}} = {{{{g\_ sampleWeight}_{L}\left\lbrack {A\mspace{11mu}\%\mspace{11mu} N} \right\rbrack}\left\lbrack {x ⪢ {ratioWH}} \right)} + {offsetX}}} \right\rbrack\left. \quad{\left\lbrack {y ⪢ {ratioHW}} \right) + {offsetY}} \right\rbrack}} \right.$

where (x,y) represents the position of each chroma sample.

The size of pre-defined masks in the first set may not be 256×256. Thesize may depend on the maximum block size and maximum shift offset.Assuming that the maximum block size is S, the number of supporteddistances is N_(d), and the shift offset for each distance is defined asfollows: offset=(D×S)>>O. Then, the width and height of pre-definedmasks can be calculated as follows.

S+((((N _(d)−1)>>1)×S)>>O)<<1

In one example, the variables S, N_(d), and O are set to 128, 9, and 4,respectively. The size of pre-defined masks is set to 192×192. Inanother example, the variables S, N_(d), and O are set to 128, 7, and 3,respectively. The size of pre-defined masks is set to 224×224.

In some embodiments, same as the cropped method, a first and a secondset of masks are pre-defined. The first set of masks,g_sampleWeight_(L)[ ], may contain several masks whose size is 256×256,and the masks are used to derive blending weights for each block. Thesecond set of masks, g_motionMask[ ], may contain several masks whosesize is 64×64, and the masks are used to derive the mask for motionfield storage for each block. For square blocks, same as the croppedmethod, the masks are cropped from one of mask in the first and thesecond set. For non-square blocks, the masks are cropped from one ofmask in the first and the second set, followed by an upsampling process.

In one embodiment, the pre-defined masks in the first set and the secondset may be calculated using the equations described above. The number ofmasks in the first set and the second set are both N, where N is set tothe number of angles supported in geometric partition mode. The n^(th)masks with index n in the first and the second set represent the mask ofangle n, where n ranges from 0 to N−1. For a block whose size is W×Hwith geometric partitioning index set to K, the mask for blendingweights of luma samples are derived as follows.

-   -   Variables angleIdx A and distanceIdx D are obtained from a        look-up table using the geometric partitioning index K. Examples        of the look-up table are shown in Table 15C, Table 15D, Table        22B, Table 30, and Table 31.    -   A variable minSize is set to min(W, H)    -   Variables ratioWH and ratioHW is set to log 2(max(W/H, 1)) and        log 2(max(H/W, 1)), respectively    -   Variables offset X and offset Y can be calculated as follows:

${offsetX} = \left\{ {{\begin{matrix}{\left( {256 - {minSize}} \right) ⪢ 1} & {{{horizontal}\mspace{14mu}{split}\mspace{14mu}{or}}\;} \\\; & \left( {{{not}\mspace{14mu}{vertical}\mspace{14mu}{and}\mspace{14mu} H} \geq W} \right) \\{{\left( {\left( {256 - {minSize}} \right) ⪢ 1} \right) + A} < {N?}} & {otherwise} \\{\left( {D \times {minSize}} \right) ⪢ {{3\text{:}} - \left( {\left( {D \times {minSize}} \right) ⪢ 3} \right)}} & \;\end{matrix}{offsetY}} = {\left\{ {{\begin{matrix}{{\left( {\left( {256 - {minSize}} \right) ⪢ 1} \right) + A} < {N?}} & {{{horizontal}\mspace{14mu}{split}\mspace{14mu}{or}}\mspace{11mu}} \\{\left( {D \times {minSize}} \right) ⪢ {{3\text{:}} - \left( {\left( {D \times {minSize}} \right) ⪢ 3} \right)}} & \left( {{{not}\mspace{14mu}{vertical}\mspace{14mu}{and}\mspace{14mu} H} \geq W} \right) \\{\left( {256 - {minSize}} \right) ⪢ 1} & {otherwise}\end{matrix}{{{sampleWeight}_{L}\lbrack x\rbrack}\lbrack y\rbrack}} = {{{{g\_ sampleWeight}_{L}\left\lbrack {A\mspace{11mu}\%\mspace{11mu} N} \right\rbrack}\left\lbrack {x ⪢ {ratioWH}} \right)} + {offsetX}}} \right\rbrack\left. \quad{\left\lbrack {y ⪢ {ratioHW}} \right) + {offsetY}} \right\rbrack}} \right.$

The blending weights for chroma samples are subsampled from the weightsof luma samples. That is, the weight of top-left luma sample for eachcorresponding 2×2 luma subblock is used as the weight of chroma samplefor YUV 4:2:0 video format.

On the other hands, the mask for motion field storage is derived asfollows:

-   -   A variable minSubblk is set to min(W, H)>>2    -   Variables offsetXmotion and offsetYmotion can be calculated as        follows:

${offsetXmotion} = \left\{ {{\begin{matrix}{\left( {64 - \left( {{minSubblk} ⪢ 2} \right)} \right) ⪢ 1} & {{{horizontal}\mspace{14mu}{split}\mspace{14mu}{or}}\mspace{11mu}} \\\; & \left( {{{not}\mspace{14mu}{vertical}\mspace{14mu}{and}\mspace{14mu} H} \geq W} \right) \\{{\left. {\left( \left( {{64 - {minSubblk}} ⪢ 2} \right) \right) ⪢ 1} \right) + A} < {N?}} & {otherwise} \\{\left. {D \times {minSubblk}} \right) ⪢ {{5\text{:}} - \left( \left( {D \times {minSubblk}} \right) \right.}} & \; \\{⪢ 5} & \;\end{matrix}{offsetYmotion}} = \left\{ \begin{matrix}{{\left( {\left( {64 - \left( {{minSubblk} ⪢ 2} \right)} \right) ⪢ 1} \right) + A} < {N?}} & {{{horizontal}\mspace{14mu}{split}\mspace{14mu}{or}}\mspace{11mu}} \\{\left( {D \times {minSubblk}} \right) ⪢ {{5\text{:}} - \left( \left( {D \times {minSubblk}} \right) \right.}} & \left( {{{not}\mspace{14mu}{vertical}\mspace{14mu}{and}\mspace{14mu} H} \geq W} \right) \\\left. {⪢ 5} \right) & \; \\{\left( {64 - \left( {{minSubblk} ⪢ 2} \right)} \right) ⪢ 1} & {otherwise}\end{matrix} \right.} \right.$

In another embodiment, the pre-defined masks in the first set and thesecond set may be calculated using the equations described above. Thenumber of masks in the first set and the second set are bothN_(reduced), where N_(reduced)=(N>>1)+1 and N is the number of anglessupported in geometric partition mode. For a block whose size is W×Hwith geometric partitioning index set to K, the mask for blendingweights of luma samples are derived as follows.

-   -   Variables angleIdx A and distanceIdx D are obtained from a        look-up table using the geometric partitioning index K. Examples        of the look-up table are shown in Table 15C, Table 15D, Table        22B, Table 30, and Table 31.    -   A variable minSize is set to min(W, H)    -   Variables ratioWH and ratioHW is set to log 2(max(W/H, 1)) and        log 2(max(H/W, 1)), respectively    -   Variables offsetX and offsetY can be calculated as follows:

${offsetX} = \left\{ {{\begin{matrix}{\left( {256 - {minSize}} \right) ⪢ 1} & {{{horizontal}\mspace{14mu}{split}\mspace{14mu}{or}}\mspace{11mu}} \\\; & \left( {{{not}\mspace{14mu}{vertical}\mspace{14mu}{and}\mspace{14mu} H} \geq W} \right) \\{{\left( {\left( {256 - {minSize}} \right) ⪢ 1} \right) + A} < {N?}} & {otherwise} \\{\left( {D \times {minSize}} \right) ⪢ {{3\text{:}} - \left( {\left( {D \times {minSize}} \right) ⪢ 3} \right)}} & \;\end{matrix}{offsetY}} = \left\{ {{\begin{matrix}{{\left( {\left( {256 - {minSize}} \right) ⪢ 1} \right) + A} < {N?}} & {{{horizontal}\mspace{14mu}{split}\mspace{14mu}{or}}\mspace{11mu}} \\{\left( {D \times {minSize}} \right) ⪢ {{3\text{:}} - \left( {\left( {D \times {minSize}} \right) ⪢ 3} \right)}} & \left( {{{not}\mspace{14mu}{vertical}\mspace{14mu}{and}\mspace{14mu} H} \geq W} \right) \\{\left( {256 - {minSize}} \right) ⪢ 1} & {otherwise}\end{matrix}{{{sampleWeight}_{L}\lbrack x\rbrack}\lbrack y\rbrack}} = \left\{ \begin{matrix}{{{g\_ sampleWeight}_{L}\left\lbrack {A\mspace{11mu}\%\mspace{11mu} N} \right\rbrack}\left\lbrack \left( {x ⪢ {ratioWH}} \right) \right.} & {{A\mspace{11mu}\%\mspace{11mu} N} < N_{reduced}} \\\left. {{\left. {+ {offset}} \right\rbrack\left\lbrack {y ⪢ {ratioHW}} \right)} + {offset}} \right\rbrack & \; \\{{{g\_ sampleWeight}_{L}\left\lbrack {N - {A\mspace{11mu}\%\mspace{11mu} N}} \right\rbrack}\left\lbrack {{minSize} - 1 -} \right.} & {otherwise} \\{\left. {\left( {x ⪢ {ratioWH}} \right) + {offsetX}} \right\rbrack\left\lbrack {\left( {y ⪢ {ratioHW}} \right) + {offsetY}} \right\rbrack} & \;\end{matrix} \right.} \right.} \right.$

The blending weights for chroma samples are subsampled from the weightsof luma samples. That is, the weight of top-left luma sample for eachcorresponding 2×2 luma subblock is used as the weight of chroma samplefor YUV 4:2:0 video format.

On the other hands, the mask for motion field storage is derived asfollows:

-   -   A variable minSubblk is set to min(W, H)>>2    -   Variables offsetXmotion and offsetYmotion can be calculated as        follows:

${offsetXmotion} = \left\{ {{\begin{matrix}{\left( {64 - \left( {{minSubblk} ⪢ 2} \right)} \right) ⪢ 1} & {{{horizontal}\mspace{14mu}{split}\mspace{14mu}{or}}\mspace{11mu}} \\\; & \left( {{{not}\mspace{14mu}{vertical}\mspace{14mu}{and}\mspace{14mu} H} \geq W} \right) \\{{\left. {\left( \left( {{64 - {minSubblk}} ⪢ 2} \right) \right) ⪢ 1} \right) + A} < {N?}} & {otherwise} \\{\left. {D \times {minSubblk}} \right) ⪢ {{5\text{:}} - \left( \left( {D \times {minSubblk}} \right) \right.}} & \; \\{⪢ 5} & \;\end{matrix}{offsetYmotion}} = \left\{ {{\begin{matrix}{{\left( {\left( {64 - \left( {{minSubblk} ⪢ 2} \right)} \right) ⪢ 1} \right) + A} < {N?}} & {{{horizontal}\mspace{14mu}{split}\mspace{14mu}{or}}\mspace{11mu}} \\{\left( {D \times {minSubblk}} \right) ⪢ {{5\text{:}} - \left( \left( {D \times {minSubblk}} \right) \right.}} & \left( {{{not}\mspace{14mu}{vertical}\mspace{14mu}{and}\mspace{14mu} H} \geq W} \right) \\\left. {⪢ 5} \right) & \; \\{\left( {64 - \left( {{minSubblk} ⪢ 2} \right)} \right) ⪢ 1} & {otherwise}\end{matrix}{{{motionMask}\left\lbrack x_{subblk} \right\rbrack}\left\lbrack y_{subblk} \right\rbrack}} = \left\{ \begin{matrix}{{{g\_ motionMask}\left\lbrack {A\mspace{11mu}\%\mspace{11mu} N} \right\rbrack}\left\lbrack {\left( {x_{subblk} ⪢ {rationWH}} \right) +} \right.} & {{A\mspace{11mu}\%\mspace{11mu} N} < N_{reduced}} \\\left. {{\left. {offsetXmotion} \right\rbrack\left\lbrack {y_{subblk} ⪢ {rationHW}} \right)} + {offsetYmotion}} \right\rbrack & \; \\{{{{g\_ motionMask}\left\lbrack {N - {A\mspace{11mu}\%\mspace{11mu} N}} \right\rbrack}\left\lbrack {x_{subblk} ⪢ {ratioWH}} \right)} +} & {otherwise} \\\left. {{\left. {offsetXmotion} \right\rbrack\left\lbrack {y_{subblk} ⪢ {ratioHW}} \right)} + {offsetYmotion}} \right\rbrack & \;\end{matrix} \right.} \right.} \right.$

In a third embodiment, the pre-defined masks in the first set and thesecond set may be calculated using the equations described above. Thenumber of masks in the first set and the second set are bothN_(reduced), where N_(reduced)=(N>>1)+1 and N is the number of anglessupported in geometric partition mode. For a block whose size is W×Hwith geometric partitioning index set to K, the mask for blendingweights of luma samples are derived as follows.

-   -   Variables angleIdx A and distanceIdx D are obtained from a        look-up table using the geometric partitioning index K. Examples        of the look-up table are shown in Table 15C, Table 15D, Table        22B, Table 30, and Table 31.    -   A variable minSize is set to min(W, H)    -   Variables ratioWH and ratioHW is set to log 2(max(W/H, 1)) and        log 2(max(H/W, 1)), respectively    -   Variables offsetX and offsetY can be calculated as follows:

${offsetX} = \left\{ {{\begin{matrix}{\left( {256 - {minSize}} \right) ⪢ 1} & \begin{matrix}{{horizontal}\mspace{14mu}{split}\mspace{14mu}{or}} \\\left( {{{not}\mspace{14mu}{vertical}\mspace{14mu}{split}\mspace{14mu}{and}\mspace{14mu} H} \geq W} \right)\end{matrix} \\\begin{matrix}{{\left( {\left( {256 - {minSize}} \right) ⪢ 1} \right) + A} < {{N\;?}\mspace{11mu}\left( {D \times {minSize}} \right)} ⪢ {3\text{:}}} \\{- \left( {\left( {D \times {minSize}} \right) ⪢ 3} \right)}\end{matrix} & {otherwise}\end{matrix}{offsetY}} = \left\{ {{\begin{matrix}\begin{matrix}{{\left( {\left( {256 - {minSize}} \right) ⪢ 1} \right) + A} < {{N\;?}\mspace{14mu}\left( {D \times {minSize}} \right)} ⪢ {3\text{:}}} \\{- \left( {\left( {D \times {minSize}} \right) ⪢ 3} \right)}\end{matrix} & \begin{matrix}{{horizontal}\mspace{14mu}{split}\mspace{14mu}{or}} \\\left( {{{not}\mspace{14mu}{vertical}\mspace{14mu}{split}\mspace{14mu}{and}\mspace{14mu} H} \geq W} \right)\end{matrix} \\{\left( {256 - {minSize}} \right) ⪢ 1} & {otherwise}\end{matrix}\mspace{79mu}{{{sampleWeight}_{L}\lbrack x\rbrack}\lbrack y\rbrack}} = \left\{ \begin{matrix}\begin{matrix}\begin{matrix}{{g\_ sampleWeight}_{L}\left\lbrack {A\mspace{14mu}\%\mspace{14mu} N} \right\rbrack} \\\left\lbrack {\left( {x ⪢ {ratioWH}} \right) + {offsetX}} \right\rbrack\end{matrix} \\\left\lbrack {\left( {y ⪢ {ratioHW}} \right) + {offsetY}} \right\rbrack\end{matrix} & {{A\mspace{14mu}\%\mspace{14mu} N} < N_{reduced}} \\\begin{matrix}\begin{matrix}{{g\_ sampleWeight}_{L}\left\lbrack {N - {A\mspace{14mu}\%\mspace{14mu} N}} \right\rbrack} \\\left\lbrack {\left( {x ⪢ {ratioWH}} \right) + {offsetX}} \right\rbrack\end{matrix} \\\left\lbrack {{minSize} - 1 - \left( {y ⪢ {ratioHW}} \right) + {offsetY}} \right\rbrack\end{matrix} & {otherwise}\end{matrix} \right.} \right.} \right.$

The blending weights for chroma samples are subsampled from the weightsof luma samples. That is, the weight of top-left luma sample for eachcorresponding 2×2 luma subblock is used as the weight of chroma samplefor YUV 4:2:0 video format.

On the other hands, the mask for motion field storage is derived asfollows:

-   -   A variable minSubblk is set to min(W, H)>>2    -   Variables offsetXmotion and offsetYmotion can be calculated as        follows:

${offsetXmotion} = \left\{ {{\begin{matrix}{\left( {64 - \left( {{minSubblk} ⪢ 2} \right)} \right) ⪢ 1} & \begin{matrix}{{horizontal}\mspace{14mu}{split}\mspace{14mu}{or}} \\\left( {{{not}\mspace{14mu}{vertical}\mspace{14mu}{split}\mspace{14mu}{and}\mspace{14mu} H} \geq W} \right)\end{matrix} \\\begin{matrix}{{\left( {\left( {64 - \left( {{minSubblk} ⪢ 2} \right)} \right) ⪢ 1} \right) + A} < {{N\mspace{11mu}?}\mspace{14mu}\left( {D \times {minSubblk}} \right)} ⪢ {5\text{:}}} \\{- \left( {\left( {D \times {minSubblk}} \right) ⪢ 5} \right)}\end{matrix} & {otherwise}\end{matrix}{offsetYmotion}} = \left\{ {{\begin{matrix}\begin{matrix}{{\left( {\left( {64 - \left( {{minSubblk} ⪢ 2} \right)} \right) ⪢ 1} \right) + A} < {{N\;?}\mspace{14mu}\left( {D \times {minSubblk}} \right)} ⪢ {5\text{:}}} \\{- \left( {\left( {D \times {minSubblk}} \right) ⪢ 5} \right)}\end{matrix} & \begin{matrix}{{horizontal}\mspace{14mu}{split}\mspace{14mu}{or}} \\\left( {{{not}\mspace{14mu}{vertical}\mspace{14mu}{split}\mspace{14mu}{and}\mspace{14mu} H} \geq W} \right)\end{matrix} \\{\left( {64 - \left( {{minSubblk} ⪢ 2} \right)} \right) ⪢ 1} & {otherwise}\end{matrix}\mspace{79mu}{{{motionMask}\;\left\lbrack x_{subblk} \right\rbrack}\left\lbrack y_{subblk} \right\rbrack}} = \left\{ \begin{matrix}\begin{matrix}\begin{matrix}{{g\_ motionMask}\left\lbrack {A\mspace{14mu}\%\mspace{14mu} N} \right\rbrack} \\\left\lbrack {\left( {x_{subblk} ⪢ {ratioWH}} \right) + {offsetXmotion}} \right\rbrack\end{matrix} \\\left\lbrack {\left( {y_{subblk} ⪢ {ratioHW}} \right) + {offsetYmotion}} \right\rbrack\end{matrix} & {{A\mspace{14mu}\%\mspace{14mu} N} < N_{reduced}} \\\begin{matrix}\begin{matrix}{{g\_ motionMask}\left\lbrack {N - {A\mspace{14mu}\%\mspace{14mu} N}} \right\rbrack} \\\left\lbrack {\left( {x_{subblk} ⪢ {ratioWH}} \right) + {offsetmotionX}} \right\rbrack\end{matrix} \\\begin{bmatrix}{{minSubblk} - 1 -} \\{\left( {y_{subblk} ⪢ {ratioHW}} \right) + {offsetmotionY}}\end{bmatrix}\end{matrix} & {otherwise}\end{matrix} \right.} \right.} \right.$

It is noted that different methods for offset and chroma weightsderivation described above can also be applied herein.

In the original design for geometric partition mode, the combination ofpartitioning a block cross the block center with 135° or 45° are alwaysexcluded. The main purpose is to remove the redundant partition optionwith triangle partition mode from geometric partition mode. However, thepartitioning angle is neither 135° nor 45° for non-square blocks codedusing triangle partition mode. Therefore, two angles can be adaptivelyexcluded based on block shape.

In some embodiments of the disclosure, the two angles that are excludedare changed based on block shape. For the square blocks, 135° and 45°are excluded, which is the same as original geometric partition design.For other block shape, the excluded angles are listed in Table 37 ofFIG. 37. For example, for a block whose size is 8×16 (i.e. width toheight ratio is 1 to 2), the angles 112.5° and 67.5° are excluded, thatis, angleIdx 10 and angleIdx 6. Then, the look-up table for thegeometric partitioning index is modified as Table 38 of FIG. 38. Theparts of Table 38 related to the excluded angles are highlighted in greyin FIG. 38.

It is noted that this embodiment can be combined with other embodimentsin this disclosure. For example, the masks of blending weights andmotion field storage using the excluded angles can be calculated usingthe methods of triangle partition mode. For the other angles, thecropped methods are used to derive the masks.

As mentioned before, the blending process, motion field storage andsyntax structure used in triangle partition and geometric modes are notunified. In this disclosure, it is proposed to unify all the processes.

In one embodiment, the proposed cropped method described above is usedin the processes of blending and motion field storage for both triangleand geometric partition modes. Besides, the look-up table for angle anddistance of each geometric partitioning submode is removed. A first anda second set of masks are pre-defined and may be calculated using theequations described above, respectively. The number of masks in thefirst and the second set are both N_(reduced), whereN_(reduced)=(N>>1)+1 and N is the number of angles supported ingeometric partition mode. Let N_(D) represents the number of distancessupported in geometric partition mode. Thus, the total number ofgeometric partition submodes are N×N_(D). In one example, N and N_(D)are set to 8 and 7, respectively. In another example, N and N_(D) areset to 12 and 7, respectively. In other example, N and N_(D) are set toan even number and an odd number, respectively.

For a block whose size is W×H with geometric partitioning index set toK, the mask for blending weights of luma samples are derived as follows.

-   -   A variable N_(halfD) is set to N_(D)>>1.    -   Variables angleIdx A and distanceIdx D are set to K % N and K/N,        respectively.    -   Variables offsetX and offsetY are calculated as follows:

${offsetX} = \left\{ {{\begin{matrix}{\left( {256 - W} \right) ⪢ 1} & \begin{matrix}{{horizontal}\mspace{14mu}{split}\mspace{14mu}{or}} \\\left( {{{not}\mspace{14mu}{vertical}\mspace{14mu}{split}\mspace{14mu}{and}\mspace{14mu} H} \geq W} \right)\end{matrix} \\\begin{matrix}{{\left( {\left( {256 - W} \right) ⪢ 1} \right) + D} > {{N_{halfD}\;?}\mspace{14mu}\left( {\left( {D - N_{halfD}} \right) \times W} \right)} ⪢ {3\text{:}}} \\{- \left( {\left( {D \times W} \right) ⪢ 3} \right)}\end{matrix} & {otherwise}\end{matrix}{offsetY}} = \left\{ {{\begin{matrix}\begin{matrix}{{\left( {\left( {256 - H} \right) ⪢ 1} \right) + D} > {{N_{halfD}\;?}\mspace{14mu}\left( {\left( {D - N_{halfD}} \right) \times H} \right)} ⪢ {3\text{:}}} \\{- \left( {\left( {D \times H} \right) ⪢ 3} \right)}\end{matrix} & \begin{matrix}{{horizontal}\mspace{14mu}{split}\mspace{14mu}{or}} \\\left( {{{not}\mspace{14mu}{vertical}\mspace{14mu}{split}\mspace{14mu}{and}\mspace{14mu} H} \geq W} \right)\end{matrix} \\{\left( {256 - H} \right) ⪢ 1} & {otherwise}\end{matrix}\mspace{76mu}\text{-}\;{{{sampleWeight}_{L}\lbrack x\rbrack}\lbrack y\rbrack}} = \left\{ \begin{matrix}\begin{matrix}{{g\_ sampleWeight}_{L}\lbrack A\rbrack} \\{\left\lbrack {x + {offsetX}} \right\rbrack\left\lbrack {y + {offsetY}} \right\rbrack}\end{matrix} & {A\; < N_{reduced}} \\\begin{matrix}{{g\_ sampleWeight}_{L}\left\lbrack {N - A} \right\rbrack} \\{\left\lbrack {W - 1 - x + {offsetX}} \right\rbrack\left\lbrack {y + {offsetY}} \right\rbrack}\end{matrix} & {otherwise}\end{matrix} \right.} \right.} \right.$

The blending weights for chroma samples are subsampled from the weightsof luma samples. That is, the weight of top-left luma sample for eachcorresponding 2×2 luma subblock is used as the weight of chroma samplefor YUV 4:2:0 video format.

On the other hands, the mask for motion field storage is derived asfollows:

-   -   Variables offsetXmotion and offsetYmotion are calculated as        follows:

${offsetXmotion} = \left\{ {{\begin{matrix}{\left( {64 - \left( {W ⪢ 2} \right)} \right) ⪢ 1} & \begin{matrix}{{horizontal}\mspace{14mu}{split}\mspace{14mu}{or}} \\\left( {{{not}\mspace{14mu}{vertical}\mspace{14mu}{split}\mspace{14mu}{and}\mspace{14mu} H} \geq W} \right)\end{matrix} \\\begin{matrix}{{\left( {\left( {64 - \left( {W ⪢ 2} \right)} \right) ⪢ 1} \right) + D} > {{N_{halfD}\;?}\mspace{14mu}\left( {\left( {D - N_{halfD}} \right) \times W} \right)} ⪢ {5\text{:}}} \\{- \left( {\left( {D \times W} \right) ⪢ 5} \right)}\end{matrix} & {otherwise}\end{matrix}{offsetYmotion}} = \left\{ {{\begin{matrix}\begin{matrix}{{\left( {\left( {64 - \left( {H ⪢ 2} \right)} \right) ⪢ 1} \right) + D} > {{N_{halfD}\;?}\mspace{14mu}\left( {\left( {D - N_{halfD}} \right) \times H} \right)} ⪢ {5\text{:}}} \\{- \left( {\left( {D \times H} \right) ⪢ 5} \right)}\end{matrix} & \begin{matrix}{{horizontal}\mspace{14mu}{split}\mspace{14mu}{or}} \\\left( {{{not}\mspace{14mu}{vertical}\mspace{14mu}{split}\mspace{14mu}{and}\mspace{14mu} H} \geq W} \right)\end{matrix} \\{\left( {64 - \left( {H ⪢ 2} \right)} \right) ⪢ 1} & {otherwise}\end{matrix}{{{motionMask}\;\left\lbrack x_{subblk} \right\rbrack}\left\lbrack y_{subblk} \right\rbrack}} = \left\{ \begin{matrix}\begin{matrix}{{{g\_ motionMask}\lbrack A\rbrack}\left\lbrack {x_{subblk} + {offsetXmotion}} \right\rbrack} \\\left\lbrack {y_{subblk} + {offsetYmotion}} \right\rbrack\end{matrix} & {A < N_{reduced}} \\\begin{matrix}{{{g\_ motionMask}\left\lbrack {N - A} \right\rbrack}\begin{bmatrix}{\left( {W ⪢ 2} \right) - 1 - x_{subblk} +} \\{offsetXmotion}\end{bmatrix}} \\\left\lbrack {y_{subblk} + {offsetYmotion}} \right\rbrack\end{matrix} & {otherwise}\end{matrix} \right.} \right.} \right.$

The number of bits needed to store the pre-defined masks are(256×256)×((N>>1)+1)×4+(64×64)×((N>>1)+1)×2.

N = 16 N = 12 N = 8 Memory of the proposed method 304,128 236,544168,960 bytes bytes bytes % of reduction compared to 140 geometric 91.2%93.2% 95.1% partitioning submodes + triangle mode % of reductioncompared to 108 geometric 88.6% 91.2% 93.7% partitioning submodes +triangle mode % of reduction compared to 80 geometric 84.8% 88.1% 91.5%partitioning submodes + triangle mode % of reduction compared to 64geometric 81.1% 85.3% 89.5% partitioning submodes + triangle mode

In another embodiment, the proposed cropped method described above isused in the processes of blending and motion field storage for bothtriangle and geometric partition modes. Besides, the look-up table forangle and distance of each geometric partitioning submode is removed. Afirst and a second set of masks are pre-defined and may be calculatedusing the equations described above, respectively. The number of masksin the first and the second set are both N_(reduced), whereN_(reduced)=(N>>1)+1 and N is the number of angles supported ingeometric partition mode. Let N_(D) represents the number of distancessupported in geometric partition mode. Therefore, the total number ofgeometric partition submodes are N×N_(D).

For a block whose size is W×H with geometric partitioning index set toK, the mask for blending weights of luma samples are derived as follows:

-   -   A variable N_(halfD) is set to N_(D)>>1.    -   Variables angleIdx A and distanceIdx D are set to K % N and K/N,        respectively.    -   Variables offsetX and offsetY are calculated as follows:

${offsetX} = \left\{ {{\begin{matrix}{\left( {256 - W} \right) ⪢ 1} & \begin{matrix}{{horizontal}\mspace{14mu}{split}\mspace{14mu}{or}} \\\left( {{{not}\mspace{14mu}{vertical}\mspace{14mu}{split}\mspace{14mu}{and}\mspace{14mu} H} \geq W} \right)\end{matrix} \\\begin{matrix}{{\left( {\left( {256 - W} \right) ⪢ 1} \right) + D} > {{N_{halfD}?}\mspace{11mu}\left( {\left( {D - N_{halfD}} \right) \times W} \right)} ⪢ {3\text{:}}} \\{- \left( {\left( {D \times W} \right) ⪢ 3} \right)}\end{matrix} & {otherwise}\end{matrix}{offsetY}} = \left\{ {{\begin{matrix}\begin{matrix}{{\left( {\left( {256 - H} \right) ⪢ 1} \right) + D} > {{N_{halfD}?}\mspace{11mu}\left( {\left( {D - N_{halfD}} \right) \times H} \right)} ⪢ {3\text{:}}} \\{- \left( {\left( {D \times H} \right) ⪢ 3} \right)}\end{matrix} & \begin{matrix}{{horizontal}\mspace{14mu}{split}\mspace{14mu}{or}} \\\left( {{{not}\mspace{14mu}{vertical}\mspace{14mu}{split}\mspace{14mu}{and}\mspace{14mu} H} \geq W} \right)\end{matrix} \\{\left( {256 - H} \right) ⪢ 1} & {otherwise}\end{matrix}\mspace{20mu}\text{-}{{{sampleWeight}_{L}\lbrack x\rbrack}\lbrack y\rbrack}} = \left\{ \begin{matrix}\begin{matrix}{{g\_ sampleWeight}_{L}\lbrack A\rbrack} \\{\left\lbrack {x + {offsetX}} \right\rbrack\left\lbrack {y + {offsetY}} \right\rbrack}\end{matrix} & {A\; < N_{reduced}} \\\begin{matrix}{{g\_ sampleWeight}_{L}\left\lbrack {N - A} \right\rbrack} \\{\left\lbrack {x + {offsetX}} \right\rbrack\left\lbrack {H - 1 - y + {offsetY}} \right\rbrack}\end{matrix} & {otherwise}\end{matrix} \right.} \right.} \right.$

The blending weights for chroma samples are subsampled from the weightsof luma samples. That is, the weight of top-left luma sample for eachcorresponding 2×2 luma subblock is used as the weight of chroma samplefor YUV 4:2:0 video format.

On the other hands, the mask for motion field storage is derived asfollows.

-   -   Variables offsetXmotion and offsetYmotion are calculated as        follows:

${offsetXmotion} = \left\{ {{\begin{matrix}{\left( {64 - \left( {W ⪢ 2} \right)} \right) ⪢ 1} & \begin{matrix}{{horizontal}\mspace{14mu}{split}\mspace{14mu}{or}} \\\left( {{{not}\mspace{14mu}{vertical}\mspace{14mu}{split}\mspace{14mu}{and}\mspace{14mu} H} \geq W} \right)\end{matrix} \\\begin{matrix}{{{\left( {\left( {64 - \left( {W ⪢ 2} \right)} \right) ⪢ 1} \right) + D} > {N_{halfD}\;?}}\mspace{11mu}} \\{\left( {\left( {D - N_{halfD}} \right) \times W} \right) ⪢ {{5\text{:}} - \left( {\left( {D \times W} \right) ⪢ 5} \right)}}\end{matrix} & {otherwise}\end{matrix}{offsetYmotion}} = \left\{ {{\begin{matrix}\begin{matrix}{{\left( {\left( {64 - \left( {H ⪢ 2} \right)} \right) ⪢ 1} \right) + D} > {N_{halfD}\;?}} \\{\left( {\left( {D - N_{halfD}} \right) \times H} \right) ⪢ {{5\text{:}} - \left( {\left( {D \times H} \right) ⪢ 5} \right)}}\end{matrix} & \begin{matrix}{{horizontal}\mspace{14mu}{split}\mspace{14mu}{or}} \\\left( {{{not}\mspace{14mu}{vertical}\mspace{14mu}{split}\mspace{14mu}{and}\mspace{14mu} H} \geq W} \right)\end{matrix} \\{\left( {64 - \left( {H ⪢ 2} \right)} \right) ⪢ 1} & {otherwise}\end{matrix}{{{motionMask}\;\left\lbrack x_{subblk} \right\rbrack}\left\lbrack y_{subblk} \right\rbrack}} = \left\{ \begin{matrix}\begin{matrix}{{{g\_ motionMask}\lbrack A\rbrack}\left\lbrack {x_{subblk} + {offsetXmotion}} \right\rbrack} \\\left\lbrack {y_{subblk} + {offsetYmotion}} \right\rbrack\end{matrix} & {A < N_{reduced}} \\\begin{matrix}{{{g\_ motionMask}\left\lbrack {N - A} \right\rbrack}\left\lbrack {x_{subblk} + {offsetXmotion}} \right\rbrack} \\\left\lbrack {\left( {H ⪢ 2} \right) - 1 - y_{subblk} + {offsetYmotion}} \right\rbrack\end{matrix} & {otherwise}\end{matrix} \right.} \right.} \right.$

In a third embodiment, the proposed upsampled method described above isused in the processes of blending and motion field storage for bothtriangle and geometric partition modes. Besides, the look-up table forangle and distance of each geometric partitioning submode is removed. Afirst and a second set of masks are pre-defined and may be calculatedusing the equations described above, respectively. The number of masksin the first and the second set are both N_(reduced), whereN_(reduced)=(N>>1)+1 and N is the number of angles supported ingeometric partition mode. Let N_(D) represents the number of distancessupported in geometric partition mode. Thus, the total number ofgeometric partition submodes are N×N_(D). For a block whose size is W×Hwith geometric partitioning index set to K, the mask for blendingweights of luma samples are derived as follows.

-   -   A variable N_(halfD) is set to N_(D)>>1.    -   Variables angleIdx A and distanceIdx D are set to K % N and K/N,        respectively.    -   A variable minSize is set to min(W, H)    -   Variables ratioWH and ratioHW is set to log 2(max(W/H, 1)) and        log 2(max(H/W, 1)), respectively    -   A variable offset is calculated as follows:

offset = ((256 − minSize) ⪢ 1) + D > N_(halfD) ?  ((D − N_(halfD)) × minSize) ⪢ 3: − ((D × minSize) ⪢ 3)${\text{-}{{{sampleWeight}_{L}\lbrack x\rbrack}\lbrack y\rbrack}} = \left\{ \begin{matrix}\begin{matrix}{{g\_ sampleWeight}_{L}\lbrack A\rbrack} \\{\left\lbrack {\left( {x ⪢ {ratioWH}} \right) + {offset}} \right\rbrack\left\lbrack {\left( {y ⪢ {ratioHW}} \right) + {offset}} \right\rbrack}\end{matrix} & {A\; < N_{reduced}} \\\begin{matrix}{{g\_ sampleWeight}_{L}\left\lbrack {N - A} \right\rbrack} \\\begin{matrix}\left\lbrack {{minSize} - 1 - \left( {x ⪢ {ratioWH}} \right) + {offset}} \right\rbrack \\\left\lbrack {\left( {y ⪢ {ratioHW}} \right) + {offset}} \right\rbrack\end{matrix}\end{matrix} & {otherwise}\end{matrix} \right.$

The blending weights for chroma samples are subsampled from the weightsof luma samples. That is, the weight of top-left luma sample for eachcorresponding 2×2 luma subblock is used as the weight of chroma samplefor YUV 4:2:0 video format.

On the other hands, the mask for motion field storage is derived asfollows:

-   -   A variable minSubblk is set to min(W, H)>>2    -   A variable offsetmotion is calculated as follows:

offsetmotion = ((64 − minSubblk) ⪢ 1) + D > N_(halfD) ?  ((D − N_(halfD)) × minSize) ⪢ 5: − ((D × minSize) ⪢ 5)${{{motionMask}\;\left\lbrack x_{subblk} \right\rbrack}\left\lbrack y_{subblk} \right\rbrack} = \left\{ \begin{matrix}\begin{matrix}{{{g\_ motionMask}\lbrack A\rbrack}\left\lbrack {\left( {x_{subblk} ⪢ {ratioWH}} \right) + {offsetmotion}} \right\rbrack} \\\left\lbrack {\left( {y_{subblk} ⪢ {ratioWH}} \right) + {offsetmotion}} \right\rbrack\end{matrix} & {A\; < N_{reduced}} \\\begin{matrix}{{g\_ motionMask}\left\lbrack {N - A} \right\rbrack} \\\begin{matrix}\left\lbrack {{minSubblk} - 1 - \left( {x_{subblk} ⪢ {ratioWH}} \right) + {offsetmotion}} \right\rbrack \\\left\lbrack {\left( {y_{subblk} ⪢ {ratioHW}} \right) + {offsetmotion}} \right\rbrack\end{matrix}\end{matrix} & {otherwise}\end{matrix} \right.$

FIG. 39 is a flowchart of an exemplary method 3900 for processing videocontent, according to some embodiments of the disclosure. In someembodiments, method 3900 can be performed by a codec (e.g., an encoderusing encoding processes 200A or 200B in FIGS. 2A-2B or a decoder usingdecoding processes 300A or 300B in FIGS. 3A-3B). For example, the codeccan be implemented as one or more software or hardware components of anapparatus (e.g., apparatus 400) for encoding or transcoding a videosequence. In some embodiments, the video sequence can be an uncompressedvideo sequence (e.g., video sequence 202) or a compressed video sequencethat is decoded (e.g., video stream 304). In some embodiments, the videosequence can be a monitoring video sequence, which can be captured by amonitoring device (e.g., the video input device in FIG. 4) associatedwith a processor (e.g., processor 402) of the apparatus. The videosequence can include multiple pictures. The apparatus can perform method3900 at the level of pictures. For example, the apparatus can processone picture at a time in method 3900. For another example, the apparatuscan process a plurality of pictures at a time in method 3900. Method3900 can include steps as below.

At step 3902, a plurality of blocks can be partitioned along apartitioning edge into a first partition and a second partition.

The plurality of blocks are subblocks of a first block associated with apicture. It is appreciated that a picture can be associated with aplurality of blocks (including the first block), and each of the blockcan be divided as a plurality of subblocks. The first block can beassociated with a chroma block and a luma block. Accordingly, each ofthe plurality of blocks (e.g., the subblocks) can be associated with achroma subblock and a luma subblock. A partition mode of the pluralityof blocks (e.g., the subblocks) can be determined, and the plurality ofblocks (e.g., the subblocks) can be partitioned based on the partitionmode. The partitioning can provide improvement on inter prediction onthe first block. An exemplary partition mode can include a trianglepartition mode or a geometric partition mode.

As discussed above, the partition mode can be determined in accordancewith at least one indication signal. For example, with reference back toFIG. 19, a first indication signal (e.g., a subblock merge flag), asecond indication signal (e.g., a regular merge/MMVD flag), and a thirdindication signal (e.g., a CIIP flag) are provided to determine thepartition mode for a first block. As shown in FIG. 19, whether the firstblock is coded using a subblock merge mode can be determined accordingto the first indication signal (e.g., a subblock merge flag). Inresponse to the determination that the first block is not coded usingthe subblock merge mode, whether the first block is coded using one of aregular mode or a merge mode with motion vector differences (MMVD) canbe determined according to the second indication signal (e.g., a regularmerge/MMVD flag). In response to the determination that the first blockis not coded using the regular mode or the MMVD, whether the first blockis coded using the CIIP can be determined using the CIIP flag.

In some embodiments, before determining whether the first block is codedusing the CIIP according to the third indication signal, step 3902 canfurther include: determining whether a size of the first block satisfiesa given condition; and in response to the determination that the size ofthe first block satisfies the given condition, generating the thirdindication signal, or in response to the determination that the size ofthe first block fails to satisfy the given condition, determining thefirst block is coded using the CIIP mode. The given condition caninclude: a width and a height of the first block are both greater thanor equal to 8; and a ratio of a greater value between the width and theheight and a smaller value of between the width and the height is lessthan or equal to 4.

Then, in response to the determination that the first block is not codedusing the CIIP mode, it can be determined that the partition mode of thefirst block is one of a triangle partition mode or a geometric partitionmode.

When the partition mode of the first block is determined to be one of atriangle partition mode or a geometric partition mode, a targetpartitioning manner can be further determined according to a partitionmode index, an angle index, or a distance index. Then, the partitioningedge corresponding to the target partitioning manner can be determined.

Generally, a partition mode (a triangle partition mode or a geometricpartition mode) can be associated with a plurality of partitioningmanners, and the partition mode index can indicate a number of apartitioning manner among the plurality of partitioning manners. Thepartition mode index can be associated with the angle index and thedistance index. The angle index can indicate an angle of a partitioningedge of a given partitioning manner corresponding to the partition modeindex, and the distance index can indicate a distance between thepartitioning edge and a center of the first block.

In some embodiments, a look-up table (e.g., Table 22A of FIG. 22A orTable 22B of FIG. 22B) can include a plurality of partition modeindices, a plurality of angle indices, and a plurality of distanceindices associated with a plurality of partitioning manners. Given apartition mode index (e.g., K), an angle index and a distance indexassociated with a partitioning manner can be determined. Thus, thetarget partitioning manner can be determined in the look-up tableaccording to the partition mode index.

Among the plurality of partitioning manners, the look-up table caninclude a first partitioning manner associated with a first partitionmode index and a second partitioning manner associated with a secondpartition mode index, and the first and second partitioning manners aredirected to the triangle partition mode. For example, with reference toTable 22B of FIG. 22B, when the partition mode index of “10” isassociated with partitioning the block from a top-left corner to abottom-right corner. And, the partition mode index of “24” is associatedwith partitioning the block from a top-right corner to a bottom-leftcorner.

At step 3904, inter prediction can be performed on the plurality ofblocks to generate a first prediction signal for the first partition anda second prediction signal for the second partition. A first motionvector can be applied to the first partition to generate the firstprediction signal (e.g., a motion vector for the first partition), and asecond motion vector can be applied to the second partition to generatethe second prediction signal (e.g., a motion vector for the secondpartition). The first and second prediction signals can be stored in 4×4subblocks.

At step 3906, the first and second prediction signals for edge blocksassociated with the partitioning edge can be blended. As the first blockhas been partitioned before applying the inter prediction on the firstblock, partitions of the first block can be blended to finish the codingof the block. In some embodiments, edge blocks associated with thepartitioning edge can be blended. It is appreciated that the predictionsignal for blocks of each partition is identical. To blend the first andsecond prediction signals for the edge blocks associated with thepartitioning edge, weights for each of the edge blocks can bedetermined.

In some embodiments, a set of masks can be generated for determiningblending weights. For example, the first set of masks (e.g.,g_sampleWeight_(L)H) can contain several masks, a size of each mask is256×256, and the masks are used to derive the blending weights for eachblock. A number (i.e., N) of the set of masks can be set to a number ofangles supported in the geometric partition mode. For example, withreference to Table 22B of FIG. 22B, the number of the angles supportedin the geometric partition mode is 64, and thus, the number of masks is16. A first offset (e.g., offsetX) and a second offset (e.g., offsetY)can be determined based on a size of the block, an angle value of thetarget partitioning manner, and a distance value of the targetpartitioning manner. For example, offsetX and offsetY can be determinedfor a block with a size of W×H using the below equations.

${offsetX} = \left\{ {{\begin{matrix}{\left( {- W} \right) ⪢ 1} & \begin{matrix}{{horizontal}\mspace{14mu}{split}\mspace{14mu}{or}} \\\left( {{{not}\mspace{14mu}{vertical}\mspace{14mu}{split}\mspace{14mu}{and}\mspace{14mu} H} \geq W} \right)\end{matrix} \\{{\left( {\left( {- W} \right) ⪢ 1} \right) + A} < {{N\;?}\mspace{11mu}\left( {D \times W} \right)} ⪢ {{3\text{:}}\mspace{11mu} - \left( {\left( {D \times W} \right) ⪢ 3} \right)}} & {otherwise}\end{matrix}{offsetY}} = \left\{ \begin{matrix}{{\left( {\left( {- H} \right) ⪢ 1} \right) + A} < {{N\;?}\mspace{14mu}\left( {D \times H} \right)} ⪢ {{3:}\mspace{11mu} - \left( {\left( {D \times H} \right) ⪢ 3} \right)}} & \begin{matrix}{{horizontal}\mspace{14mu}{split}\mspace{14mu}{or}} \\\left( {{{not}\mspace{14mu}{vertical}\mspace{14mu}{split}\mspace{14mu}{and}\mspace{14mu} H} \geq W} \right)\end{matrix} \\{\left( {- H} \right) ⪢ 1} & {otherwise}\end{matrix} \right.} \right.$

wherein A and D are an angle index and a distance index, respectively.The angle index A and the distance index D can be obtained from alook-up table (e.g., Table 22B of FIG. 22B) using the partition modeindex K. Thus, a number of the set of masks is determined based on anumber of angle indices of the look-up table, the angle value of thetarget partitioning manner is determined based on the angle index of thelook-up table corresponding to the target partitioning manner, and thedistance value of the target partitioning manner is determined based onthe distance index of the look-up table corresponding to the targetpartitioning manner.

The angle index A is used to determine whether the split is horizontalor vertical. In the case that the angle index A is derived from thelook-up table Table 22B of FIG. 22B, when the angle index A is equal to8 or 24, the block is horizontal split. On the other hands, when theangle index is equal to 0 or 16, the block is vertical split. Therefore,the condition horizontal split or (not vertical split and H≥W) isequivalent to A % 16==8 or (A % 16!=0 and H≥W)

As another example, offsetX and offsetY can be determined for a blockwith a size of W×H using the below equations.

${offsetX} = \left\{ {{\begin{matrix}{\left( {- W} \right) ⪢ 1} & \begin{matrix}{{horizontal}\mspace{14mu}{split}\mspace{14mu}{or}} \\\left( {{{not}\mspace{14mu}{vertical}\mspace{14mu}{split}\mspace{14mu}{and}\mspace{14mu} H} \geq W} \right)\end{matrix} \\\begin{matrix}{{{\left( {\left( {- W} \right) ⪢ 1} \right) + D} > {N_{halfD}\;?}}\mspace{11mu}} \\{\left( {\left( {D - N_{halfD}} \right) \times W} \right) ⪢ {{3\text{:}}\mspace{11mu} - \left( {\left( {D \times W} \right) ⪢ 3} \right)}}\end{matrix} & {otherwise}\end{matrix}{offsetY}} = \left\{ \begin{matrix}\begin{matrix}{{{\left( {\left( {- H} \right) ⪢ 1} \right) + D} > {N_{halfD}\;?}}\mspace{11mu}} \\{\left( {\left( {D - N_{halfD}} \right) \times H} \right) ⪢ {{3\text{:}}\mspace{11mu} - \left( {\left( {D \times H} \right) ⪢ 3} \right)}}\end{matrix} & \begin{matrix}{{horizontal}\mspace{14mu}{split}\mspace{14mu}{or}} \\\left( {{{not}\mspace{14mu}{vertical}\mspace{14mu}{split}\mspace{14mu}{and}\mspace{14mu} H} \geq W} \right)\end{matrix} \\{\left( {- H} \right) ⪢ 1} & {otherwise}\end{matrix} \right.} \right.$

wherein N_(halfD) is a half of a number of distances supported in thegeometric partition mode, an angle index A and a distance index D can bedetermined based on the partition mode index K. For example, A=K % N,and D=K/N. Thus, the angle value of the target partitioning manner isdetermined based on the partition mode index and the number of anglessupported in the geometric partition mode, and the distance value of thetarget partitioning manner is determined based on the partition modeindex and the number of angles supported in the geometric partitionmode.

Based on the set of masks (e.g., g_sampleWeight_(L)[ ]), a plurality ofblending weights for the edge subblocks can be generated using the firstand second offsets (offsetX and offsetY) can be determined.

In some embodiments, a first offset (e.g., offsetX) and a second offset(e.g., offsetY) can be determined without using the set of masks, andblending weights can be determined on-the-fly. For example, weights foreach of the edge blocks can be calculated using the following equations:

${offsetX} = \left\{ {{\begin{matrix}{\left( {- W} \right) ⪢ 1} & \begin{matrix}{{horizontal}\mspace{14mu}{split}\mspace{14mu}{or}} \\\left( {{{not}\mspace{14mu}{vertical}\mspace{14mu}{split}\mspace{14mu}{and}\mspace{14mu} H} \geq W} \right)\end{matrix} \\{{\left( {\left( {- W} \right) ⪢ 1} \right) + A} < {{N\;?}\mspace{14mu}\left( {D \times W} \right)} ⪢ {{3\text{:}}\mspace{11mu} - \left( {\left( {D \times W} \right) ⪢ 3} \right)}} & {otherwise}\end{matrix}{offsetY}} = \left\{ {{{\begin{matrix}{{\left( {\left( {- H} \right) ⪢ 1} \right) + A} < {{N\;?}\mspace{14mu}\left( {D \times H} \right)} ⪢ {{3\text{:}}\mspace{11mu} - \left( {\left( {D \times H} \right) ⪢ 3} \right)}} & \begin{matrix}{{horizontal}\mspace{14mu}{split}\mspace{14mu}{or}} \\\left( {{{not}\mspace{14mu}{vertical}\mspace{14mu}{split}\mspace{14mu}{and}\mspace{14mu} H} \geq W} \right)\end{matrix} \\{\left( {- H} \right) ⪢ 1} & {otherwise}\end{matrix}\mspace{20mu}{displacementX}} = {{{angleIdx}{displacementY}} = {\left( {{{displancementX} + {NumAngles}} ⪢ 2} \right)\mspace{14mu}\%\mspace{11mu}{NumAngles}}}},{{where}\mspace{14mu}{NumAngles}\mspace{14mu}{is}\mspace{14mu}{set}\mspace{14mu}{to}\mspace{14mu} 32.}} \right.} \right.$

The weight (e.g., sampleWeight_(L)[x][y]) for a luma sample located atposition (x,y) can be calculated as follow:

weightIdx=(((x+offsetX)<<1)+1)*disLut[displacementX]+(((y+offsetY)<<1)+1))*disLut[displacementY]

partFlip=(angleIdx>=13&& angleIdx<=27)?0:1

weightIdx _(L)=partFlip?32+weightIdx:32−weightIdx

sampleWeight_(L)[x][y]=Clip3(0,8,(weightIdx _(L)+4)>>3)

As the first block includes a chroma block and a luma block, theplurality of blending weights can include a plurality of luma weightsfor the edge blocks and a plurality of chroma weights for the edgeblocks. Among the plurality of chroma weights, a chroma weight isdetermined based on a luma weight for a top-left corner of a 2×2subblock corresponding to the chroma weight. For example, with referenceto FIG. 7, a luma weight for a top-left corner of a 2×2 luma subblockcan be used as a chroma weight for a chroma block.

Accordingly, blending the first and second prediction signals for edgeblocks associated with the partitioning edge can further include:blending the first and second prediction signals to determine lumavalues of the edge blocks according to the plurality of luma weights forthe edge blocks; and blending the first and second prediction signals todetermine chroma values of the edge blocks according to the plurality ofchroma weights for the edge blocks.

In some embodiments, a non-transitory computer-readable storage mediumincluding instructions is also provided, and the instructions may beexecuted by a device (such as the disclosed encoder and decoder), forperforming the above-described methods. Common forms of non-transitorymedia include, for example, a floppy disk, a flexible disk, hard disk,solid state drive, magnetic tape, or any other magnetic data storagemedium, a CD-ROM, any other optical data storage medium, any physicalmedium with patterns of holes, a RAM, a PROM, and EPROM, a FLASH-EPROMor any other flash memory, NVRAM, a cache, a register, any other memorychip or cartridge, and networked versions of the same. The device mayinclude one or more processors (CPUs), an input/output interface, anetwork interface, and/or a memory.

The embodiments may further be described using the following clauses:

1. A method for processing video content, comprising:

partitioning, along a partitioning edge, a plurality of blocksassociated with a picture into a first partition and a second partition;

performing inter prediction on the plurality of blocks, to generate afirst prediction signal for the first partition and a second predictionsignal for the second partition; and

blending the first and second prediction signals for edge blocksassociated with the partitioning edge.

2. The method according to clause 1, wherein partitioning, along thepartitioning edge, the plurality of blocks further comprises:

determining a partition mode of the plurality of blocks; and

partitioning the plurality of blocks based on the partition mode.

3. The method according to clause 2, wherein the plurality of blocks aresubblocks of a first block, and determining the partition mode for theplurality of blocks further comprises:

determining, according to a first indication signal, whether the firstblock is coded using a subblock merge mode;

in response to the determination that the first block is not coded usingthe subblock merge mode, determining, according to a second indicationsignal, whether the first block is coded using one of a regular mode ora merge mode with motion vector differences (MMVD);

in response to the determination that the first block is not coded usingone of the regular mode or the MMVD, determining, according to a thirdindication signal, whether the first block is coded using a combinedinter and intra prediction (CIIP) mode; and

in response to the determination that the first block is not coded usingthe CIIP mode, determining the partition mode of the plurality of blocksis one of a triangle partition mode or a geometric partition mode.

4. The method according to clause 2 or 3, wherein partitioning, alongthe partitioning edge, the plurality of blocks further comprises:

determining a target partitioning manner according to a partition modeindex, an angle index, or a distance index; and

determining the partitioning edge corresponding to the targetpartitioning manner.

5. The method according to clause 4, further comprising:

generating a set of masks;

determining a first offset and a second offset based on a size of thefirst block, an angle value of the target partitioning manner, and adistance value of the target partitioning manner; and

generating, based on the set of masks, a plurality of blending weightsusing the first and second offsets.

6. The method according to clause 5, wherein

a number of the set of masks is determined based on a number of anglessupported in the geometric partition mode, the angle value of the targetpartitioning manner is determined based on the partition mode index andthe number of angles supported in the geometric partition mode, and thedistance value of the target partitioning manner is determined based onthe partition mode index and the number of angles supported in thegeometric partition mode.

7. The method according to clause 5 or 6, wherein determining the targetpartitioning manner according to the partition mode index, the angleindex, or the distance index further comprises:

determining the target partitioning manner according to a look-up table,wherein the look-up table comprises a plurality of partition modeindices, a plurality of angle indices, and a plurality of distanceindices associated with a plurality of partitioning manners.

8. The method according to clause 7, wherein

a number of the set of masks is determined based on a number of angleindices of the look-up table, the angle value of the target partitioningmanner is determined based on an angle index of the look-up tablecorresponding to the target partitioning manner, and the distance valueof the target partitioning manner is determined based on a distanceindex of the look-up table corresponding to the target partitioningmanner.

9. The method according to clause 7 or 8, wherein the look-up tablecomprises, among the plurality of partitioning manners, a firstpartitioning manner associated with a first partition mode index and asecond partitioning manner associated with a second partition modeindex, the first and second partitioning manners corresponding to thetriangle partition mode.

10. The method according to clause 9, wherein the first partition modeindex is equal to 10 and the first partitioning manner associated withthe first partition mode index corresponds to splitting the block from atop-left corner to a bottom-right corner of the block, and the secondpartition mode index is equal to 24 and the second partitioning mannerassociated with the second partition mode index corresponds to splittingthe block from a top-right corner to a bottom-left corner of the block.

11. The method according to any one of clauses 5-10, wherein theplurality of blending weights comprise a plurality of luma weights forthe edge blocks and a plurality of chroma weights for the edge blocks,and blending the first and second prediction signals for the edge blocksassociated with the partitioning edge further comprises:

determining luma values of the edge blocks according to the plurality ofluma weights for the edge subblocks; and

determining chroma values of the edge subblocks according to theplurality of chroma weights for the edge subblocks.

12. The method according to clause 11, wherein, among the plurality ofchroma weights, a chroma weight is determined based on a luma weight fora top-left corner of a 2×2 block corresponding to the chroma weight.

13. The method according to clause 4, further comprising:

determining a first offset and a second offset based on a size of thefirst block, an angle value of the target partitioning manner, and adistance value of the target partitioning manner; and

generating a plurality of blending weights for luma samples in the firstblock using the first and second offsets.

14. The method according to clause 13, wherein the first offset and thesecond offset are determined using the below equations:

${{the}\mspace{14mu}{first}\mspace{14mu}{offset}} = \left\{ {{\begin{matrix}{\left( {- W} \right) ⪢ 1} & \begin{matrix}{{{A\mspace{11mu}\%\mspace{11mu} 16}=={8\mspace{14mu}{or}}}\;} \\\left( {{A\mspace{11mu}\%\mspace{11mu} 16}!={0\mspace{14mu}{and}\mspace{14mu} H} \geq W} \right)\end{matrix} \\{{\left( {\left( {- W} \right) ⪢ 1} \right) + A} < {{16\;?}\mspace{14mu}\left( {D \times W} \right)} ⪢ {{3\text{:}}\mspace{11mu} - \left( {\left( {D \times W} \right) ⪢ 3} \right)}} & {otherwise}\end{matrix}{the}\mspace{14mu}{second}\mspace{14mu}{offset}} = \left\{ {\begin{matrix}{{\left( {\left( {- H} \right) ⪢ 1} \right) + A} < {{16\;?}\mspace{11mu}\left( {D \times H} \right)} ⪢ {{3\text{:}}\mspace{11mu} - \left( {\left( {D \times H} \right) ⪢ 3} \right)}} & \begin{matrix}{{{A\mspace{11mu}\%\mspace{11mu} 16}=={8\mspace{14mu}{or}}}\;} \\\left( {{A\mspace{11mu}\%\mspace{11mu} 16}!={0\mspace{14mu}{and}\mspace{14mu} H} \geq W} \right)\end{matrix} \\{\left( {- H} \right) ⪢ 1} & {otherwise}\end{matrix},} \right.} \right.$

wherein W represents a width of the first block, H represents a heightof the first block, A represents the angle value of the targetingpartitioning manner, and D represents the distance value of thetargeting partitioning manner.

15. The method according to any one of clauses 3-14, wherein beforedetermining, according to the third indication signal, whether the firstblock is coded using the combined inter and intra prediction (CIIP)mode, the method further comprises:

determining whether a size of the first block satisfies a givencondition; and

in response to the determination that the size of the first blocksatisfies the given condition, generating the third indication signal,or

in response to the determination that the size of the block fails tosatisfy the given condition, determining the block is coded using theCIIP mode.

16. The method according to clause 15, wherein the given conditioncomprises:

a width and a height of the first block are each greater than or equalto 8; and

a ratio of a greater value between the width and the height and asmaller value between the width and the height is less than or equal to4.

17. A system for processing video content, comprising:

a memory storing a set of instructions; and

at least one processor configured to execute the set of instructions tocause the system to perform:

partitioning, along a partitioning edge, a plurality of blocksassociated with a picture into a first partition and a second partition;

performing inter prediction on the plurality of blocks, to generate afirst prediction signal for the first partition and a second predictionsignal for the second partition; and

blending the first and second prediction signals for edge blocksassociated with the partitioning edge.

18. The system according to clause 17, wherein in partitioning, alongthe partitioning edge, the plurality of blocks, the at least oneprocessor is configured to execute the set of instructions to cause thesystem to further perform:

determining a partition mode of the plurality of blocks; and

partitioning the plurality of blocks based on the partition mode.

19. The system according to clause 18, wherein the plurality of blocksare subblocks of a first block, and in determining the partition modefor the plurality of blocks, the at least one processor is configured toexecute the set of instructions to cause the system to further perform:

determining, according to a first indication signal, whether the firstblock is coded using a subblock merge mode;

in response to the determination that the first block is not coded usingthe subblock merge mode, determining, according to a second indicationsignal, whether the first block is coded using one of a regular mode ora merge mode with motion vector differences (MMVD);

in response to the determination that the first block is not coded usingone of the regular mode or the MMVD, determining, according to a thirdindication signal, whether the first block is coded using a combinedinter and intra prediction (CIIP) mode; and

in response to the determination that the first block is not coded usingthe CIIP mode, determining the partition mode of the plurality of blocksis one of a triangle partition mode or a geometric partition mode.

20. A non-transitory computer readable medium storing instructions thatare executable by at least one processor of a computer system, whereinthe execution of the instructions causes the computer system to performa method comprising:

partitioning, along a partitioning edge, a plurality of blocksassociated with a picture into a first partition and a second partition;

performing inter prediction on the plurality of blocks, to generate afirst prediction signal for the first partition and a second predictionsignal for the second partition; and

blending the first and second prediction signals for edge blocksassociated with the partitioning edge.

It should be noted that, the relational terms herein such as “first” and“second” are used only to differentiate an entity or operation fromanother entity or operation, and do not require or imply any actualrelationship or sequence between these entities or operations. Moreover,the words “comprising,” “having,” “containing,” and “including,” andother similar forms are intended to be equivalent in meaning and be openended in that an item or items following any one of these words is notmeant to be an exhaustive listing of such item or items, or meant to belimited to only the listed item or items.

As used herein, unless specifically stated otherwise, the term “or”encompasses all possible combinations, except where infeasible. Forexample, if it is stated that a database may include A or B, then,unless specifically stated otherwise or infeasible, the database mayinclude A, or B, or A and B. As a second example, if it is stated that adatabase may include A, B, or C, then, unless specifically statedotherwise or infeasible, the database may include A, or B, or C, or Aand B, or A and C, or B and C, or A and B and C.

It is appreciated that the above described embodiments can beimplemented by hardware, or software (program codes), or a combinationof hardware and software. If implemented by software, it may be storedin the above-described computer-readable media. The software, whenexecuted by the processor can perform the disclosed methods. Thecomputing units and other functional units described in this disclosurecan be implemented by hardware, or software, or a combination ofhardware and software. One of ordinary skill in the art will alsounderstand that multiple ones of the above described modules/units maybe combined as one module/unit, and each of the above describedmodules/units may be further divided into a plurality ofsub-modules/sub-units.

In the foregoing specification, embodiments have been described withreference to numerous specific details that can vary from implementationto implementation. Certain adaptations and modifications of thedescribed embodiments can be made. Other embodiments can be apparent tothose skilled in the art from consideration of the specification andpractice of the invention disclosed herein. It is intended that thespecification and examples be considered as exemplary only, with a truescope and spirit of the invention being indicated by the followingclaims. It is also intended that the sequence of steps shown in figuresare only for illustrative purposes and are not intended to be limited toany particular sequence of steps. As such, those skilled in the art canappreciate that these steps can be performed in a different order whileimplementing the same method.

In the drawings and specification, there have been disclosed exemplaryembodiments. However, many variations and modifications can be made tothese embodiments. Accordingly, although specific terms are employed,they are used in a generic and descriptive sense only and not forpurposes of limitation.

What is claimed is:
 1. A method for processing video content,comprising: partitioning, along a partitioning edge, a first blockassociated with a picture into a first partition and a second partition,the partitioning comprising: determining a target partitioning manneraccording to a partition mode index, an angle index, or a distanceindex; and determining the partitioning edge corresponding to the targetpartitioning manner; performing inter prediction on the first block, togenerate a first prediction signal for the first partition and a secondprediction signal for the second partition; determining a first offsetand a second offset based on a size of the first block, an angle valueof the target partitioning manner, and a distance value of the targetpartitioning manner, wherein the first offset and the second offset aredetermined based on the below equations:${{the}\mspace{14mu}{first}\mspace{14mu}{offset}} = \left\{ {{\begin{matrix}{\left( {- W} \right) ⪢ 1} & \begin{matrix}{{{A\mspace{11mu}\%\mspace{11mu} 16}=={8\mspace{14mu}{or}}}\;} \\\left( {{A\mspace{11mu}\%\mspace{11mu} 16}!={0\mspace{14mu}{and}\mspace{14mu} H} \geq W} \right)\end{matrix} \\{{\left( {\left( {- W} \right) ⪢ 1} \right) + A} < {{16\;?}\mspace{11mu}\left( {D \times W} \right)} ⪢ {{3\text{:}}\mspace{11mu} - \left( {\left( {D \times W} \right) ⪢ 3} \right)}} & {otherwise}\end{matrix}{the}\mspace{14mu}{second}\mspace{14mu}{offset}} = \left\{ {\begin{matrix}{{{\left( {\left( {- H} \right) ⪢ 1} \right) + A} < {{16\;?}\mspace{11mu}\left( {D \times H} \right)} ⪢ 3}:\mspace{11mu}{- \left( {\left( {D \times H} \right) ⪢ 3} \right)}} & \begin{matrix}{{{A\mspace{11mu}\%\mspace{11mu} 16}=={8\mspace{14mu}{or}}}\;} \\\left( {{A\mspace{11mu}\%\mspace{11mu} 16}!={0\mspace{14mu}{and}\mspace{14mu} H} \geq W} \right)\end{matrix} \\{\left( {- H} \right) ⪢ 1} & {otherwise}\end{matrix},} \right.} \right.$ wherein “W” represents a width of thefirst block, “H” represents a height of the first block, “A” representsthe angle value of the targeting partitioning manner, and “D” representsthe distance value of the targeting partitioning manner; generating,using the first and second offsets, a plurality of blending weights forluma samples in the first block; and blending the first and secondprediction signals for luma samples surrounding the partitioning edge ofthe first block.
 2. The method of claim 1, wherein partitioning, alongthe partitioning edge, the first block further comprises: determining apartition mode of the first block, comprising: determining, according toa first indication signal, whether the first block is coded using asubblock merge mode; in response to the determination that the firstblock is not coded using the subblock merge mode, determining, accordingto a second indication signal, whether the first block is coded usingone of a regular mode or a merge mode with motion vector differences(MMVD); and in response to the determination that the first block is notcoded using one of the regular mode or the MMVD, determining, accordingto a third indication signal, whether the first block is coded using acombined inter and intra prediction (CIIP) mode; and partitioning thefirst block based on the partition mode.
 3. The method of claim 2,wherein in response to the determination that the first block is notcoded using the CIIP mode, determining the partition mode of the firstblock is one of a triangle partition mode or a geometric partition mode.4. The method of claim 3, further comprising: generating a set of masks;and generating, based on the set of masks, a plurality of blendingweights using the first and second offsets.
 5. The method of claim 4,wherein: a number of the set of masks is determined based on a number ofangles supported in the geometric partition mode; the angle value of thetarget partitioning manner is determined based on the partition modeindex and the number of angles supported in the geometric partitionmode; and the distance value of the target partitioning manner isdetermined based on the partition mode index and the number of anglessupported in the geometric partition mode.
 6. The method of claim 4,wherein determining the target partitioning manner according to thepartition mode index, the angle index, or the distance index furthercomprises: determining the target partitioning manner according to alook-up table, wherein the look-up table comprises a plurality ofpartition mode indices, a plurality of angle indices, and a plurality ofdistance indices associated with a plurality of partitioning manners. 7.The method of claim 6, wherein: a number of the set of masks isdetermined based on a number of angle indices of the look-up table; theangle value of the target partitioning manner is determined based on anangle index of the look-up table corresponding to the targetpartitioning manner; and the distance value of the target partitioningmanner is determined based on a distance index of the look-up tablecorresponding to the target partitioning manner.
 8. The method of claim6, wherein the look-up table comprises, among the plurality ofpartitioning manners, a first partitioning manner associated with afirst partition mode index and a second partitioning manner associatedwith a second partition mode index, the first partitioning manner andthe second partitioning manner corresponding to the triangle partitionmode.
 9. The method of claim 8, wherein: the first partition mode indexis equal to 10 and the first partitioning manner associated with thefirst partition mode index corresponds to splitting the block from atop-left corner to a bottom-right corner of the block; and the secondpartition mode index is equal to 24 and the second partitioning mannerassociated with the second partition mode index corresponds to splittingthe block from a top-right corner to a bottom-left corner of the block.10. The method of claim 4, wherein the plurality of blending weightscomprise a plurality of luma weights for the luma samples surroundingthe partitioning edge and a plurality of chroma weights for the chromasamples surrounding the partitioning edge, and blending the first andsecond prediction signals for the samples associated with thepartitioning edge further comprises: determining luma values of the lumasamples according to the plurality of luma weights; and determiningchroma values of the chroma samples according to the plurality of chromaweights.
 11. The method of claim 10, wherein, among the plurality ofchroma weights, a chroma weight is determined based on a luma weight fora top-left corner of a 2×2 block corresponding to the chroma weight. 12.The method of claim 2, wherein before determining, according to thethird indication signal, whether the first block is coded using thecombined inter and intra prediction (CIIP) mode, the method furthercomprises: determining whether a size of the first block satisfies agiven condition; and in response to the determination that the size ofthe first block satisfies the given condition, generating the thirdindication signal, or in response to the determination that the size ofthe block fails to satisfy the given condition, determining the block iscoded using the CIIP mode.
 13. The method of claim 12, wherein the givencondition comprises: a width and a height of the first block are bothgreater than or equal to 8; and a ratio of a greater value between thewidth and the height and a smaller value between the width and theheight is less than or equal to
 4. 14. A system for processing videocontent, comprising: a memory storing a set of instructions; and atleast one processor configured to execute the set of instructions tocause the system to perform: partitioning, along a partitioning edge, afirst block associated with a picture into a first partition and asecond partition, the partitioning comprising: determining a targetpartitioning manner according to a partition mode index, an angle index,or a distance index; and determining the partitioning edge correspondingto the target partitioning manner; performing inter prediction on thefirst block, to generate a first prediction signal for the firstpartition and a second prediction signal for the second partition;determining a first offset and a second offset based on a size of thefirst block, an angle value of the target partitioning manner, and adistance value of the target partitioning manner, wherein the firstoffset and the second offset are determined based on the belowequations:${{the}\mspace{14mu}{first}\mspace{14mu}{offset}} = \left\{ {{\begin{matrix}{\left( {- W} \right) ⪢ 1} & \begin{matrix}{{{A\mspace{11mu}\%\mspace{11mu} 16}=={8\mspace{14mu}{or}}}\;} \\\left( {{A\mspace{11mu}\%\mspace{11mu} 16}!={0\mspace{14mu}{and}\mspace{14mu} H} \geq W} \right)\end{matrix} \\{{\left( {\left( {- W} \right) ⪢ 1} \right) + A} < {{16\;?}\mspace{11mu}\left( {D \times W} \right)} ⪢ {{3\text{:}}\mspace{11mu} - \left( {\left( {D \times W} \right) ⪢ 3} \right)}} & {otherwise}\end{matrix}{the}\mspace{14mu}{second}\mspace{14mu}{offset}} = \left\{ {\begin{matrix}{{{\left( {\left( {- H} \right) ⪢ 1} \right) + A} < {{16\;?}\mspace{11mu}\left( {D \times H} \right)} ⪢ 3}:\mspace{11mu}{- \left( {\left( {D \times H} \right) ⪢ 3} \right)}} & \begin{matrix}{{{A\mspace{11mu}\%\mspace{11mu} 16}=={8\mspace{14mu}{or}}}\;} \\\left( {{A\mspace{11mu}\%\mspace{11mu} 16}!={0\mspace{14mu}{and}\mspace{14mu} H} \geq W} \right)\end{matrix} \\{\left( {- H} \right) ⪢ 1} & {otherwise}\end{matrix},} \right.} \right.$  wherein “W” represents a width of thefirst block, “H” represents a height of the first block, “A” representsthe angle value of the targeting partitioning manner, and “D” representsthe distance value of the targeting partitioning manner; generating,using the first and second offsets, a plurality of blending weights forluma samples in the first block; and blending the first and secondprediction signals for luma samples surrounding the partitioning edge ofthe first block.
 15. The system of claim 14, wherein partitioning, alongthe partitioning edge, the first block further comprises: determining apartition mode of the first block, comprising: determining, according toa first indication signal, whether the first block is coded using asubblock merge mode; in response to the determination that the firstblock is not coded using the subblock merge mode, determining, accordingto a second indication signal, whether the first block is coded usingone of a regular mode or a merge mode with motion vector differences(MMVD); and in response to the determination that the first block is notcoded using one of the regular mode or the MMVD, determining, accordingto a third indication signal, whether the first block is coded using acombined inter and intra prediction (CIIP) mode; and partitioning thefirst block based on the partition mode.
 16. The system of claim 15,wherein before determining, according to the third indication signal,whether the first block is coded using the combined inter and intraprediction (CIIP) mode, the at least one processor is further configuredto cause the system to perform: determining whether a size of the firstblock satisfies a given condition; and in response to the determinationthat the size of the first block satisfies the given condition,generating the third indication signal, or in response to thedetermination that the size of the block fails to satisfy the givencondition, determining the block is coded using the CIIP mode.
 17. Thesystem of claim 16, wherein the given condition comprises: a width and aheight of the first block are both greater than or equal to 8; and aratio of a greater value between the width and the height and a smallervalue between the width and the height is less than or equal to
 4. 18. Anon-transitory computer readable medium storing instructions that areexecutable by at least one processor of a computer system, wherein theexecution of the instructions causes the computer system to perform amethod comprising: partitioning, along a partitioning edge, a firstblock associated with a picture into a first partition and a secondpartition, the partitioning comprising: determining a targetpartitioning manner according to a partition mode index, an angle index,or a distance index; and determining the partitioning edge correspondingto the target partitioning manner; performing inter prediction on thefirst block, to generate a first prediction signal for the firstpartition and a second prediction signal for the second partition;determining a first offset and a second offset based on a size of thefirst block, an angle value of the target partitioning manner, and adistance value of the target partitioning manner, wherein the firstoffset and the second offset are determined based on the belowequations:${{the}\mspace{14mu}{first}\mspace{14mu}{offset}} = \left\{ {{\begin{matrix}{\left( {- W} \right) ⪢ 1} & \begin{matrix}{{{A\mspace{11mu}\%\mspace{11mu} 16}=={8\mspace{14mu}{or}}}\;} \\\left( {{A\mspace{11mu}\%\mspace{11mu} 16}!={0\mspace{14mu}{and}\mspace{14mu} H} \geq W} \right)\end{matrix} \\{{\left( {\left( {- W} \right) ⪢ 1} \right) + A} < {{16\;?}\mspace{11mu}\left( {D \times W} \right)} ⪢ {{3\text{:}}\mspace{11mu} - \left( {\left( {D \times W} \right) ⪢ 3} \right)}} & {otherwise}\end{matrix}{the}\mspace{14mu}{second}\mspace{14mu}{offset}} = \left\{ {\begin{matrix}{{{\left( {\left( {- H} \right) ⪢ 1} \right) + A} < {{16\;?}\mspace{11mu}\left( {D \times H} \right)} ⪢ 3}:\mspace{11mu}{- \left( {\left( {D \times H} \right) ⪢ 3} \right)}} & \begin{matrix}{{{A\mspace{11mu}\%\mspace{11mu} 16}=={8\mspace{14mu}{or}}}\;} \\\left( {{A\mspace{11mu}\%\mspace{11mu} 16}!={0\mspace{14mu}{and}\mspace{14mu} H} \geq W} \right)\end{matrix} \\{\left( {- H} \right) ⪢ 1} & {otherwise}\end{matrix},} \right.} \right.$ wherein “W” represents a width of thefirst block, “H” represents a height of the first block, “A” representsthe angle value of the targeting partitioning manner, and “D” representsthe distance value of the targeting partitioning manner; generating,using the first and second offsets, a plurality of blending weights forluma samples in the first block; and blending the first and secondprediction signals for luma samples surrounding the partitioning edge ofthe first block.
 19. The non-transitory computer readable medium ofclaim 18, wherein partitioning, along the partitioning edge, the firstblock further comprises: determining a partition mode of the firstblock, comprising: determining, according to a first indication signal,whether the first block is coded using a subblock merge mode; inresponse to the determination that the first block is not coded usingthe subblock merge mode, determining, according to a second indicationsignal, whether the first block is coded using one of a regular mode ora merge mode with motion vector differences (MMVD); and in response tothe determination that the first block is not coded using one of theregular mode or the MMVD, determining, according to a third indicationsignal, whether the first block is coded using a combined inter andintra prediction (CIIP) mode; and partitioning the first block based onthe partition mode.
 20. The non-transitory computer readable medium ofclaim 19, wherein before determining, according to the third indicationsignal, whether the first block is coded using the combined inter andintra prediction (CIIP) mode, the method further comprises: determiningwhether a size of the first block satisfies a given condition; and inresponse to the determination that the size of the first block satisfiesthe given condition, generating the third indication signal, or inresponse to the determination that the size of the block fails tosatisfy the given condition, determining the block is coded using theCIIP mode.
 21. The non-transitory computer readable medium of claim 20,wherein the given condition comprises: a width and a height of the firstblock are both greater than or equal to 8; and a ratio of a greatervalue between the width and the height and a smaller value between thewidth and the height is less than or equal to 4.